[codepenembed height=”300″ themeid=”16787″ slughash=”ygEjby” defaulttab=”result” user=”brandonhimpfen”]See the Pen Disable Text Selection with CSS by Brandon Himpfen (@brandonhimpfen) on CodePen.[/codepen_embed]
You can use CSS if you wish to disable / disallow text selection.

Firstly, add the following to your CSS file:

.disable-selection {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}

Once you’ve added the above code snippet to your CSS file, you can use it in your HTML code by adding the disable-selection class:

<p class="disable-selection">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus</p>