In my web app the user can sometimes click the same button a number of times, skipping through messages and things, causing the </a>
to be selected.
So how can I prevent this using Javascript (jQuery)
You can use the user-select property to disable text selection of an element. In web browsers, if you double-click on some text it will be selected/highlighted. This property can be used to prevent this.
Try applying user-select: none to an element and dragging over it.
You dont need script for this, here is the css:
-webkit-touch-callout: none;
-webkit-user-select: none;
-khtml-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With