1

Firstly yes I have found this link:

Is there a way to make text unselectable on an HTML page?

but it doesn't seem to work for me. I have lots of divs containing text, making a customised table. When a user uses ctrl and clicks on multiple rows sometimes the table content gets highlighted too. Then this causes a problem when I wish to scroll across the overflow of the table.

Community
  • 1
  • 1
dave
  • 21
  • 1
  • 1
  • 5

2 Answers2

0

Use CSS to solve this problem:

body {
    -webkit-user-select: none; /* Webkit */
    -moz-user-select: none; /* Firefox */
    -ms-user-select: none; /* IE 10 */
    /* Currently not supported in Opera but will be soon */
    -o-user-select: none;
    user-select: none;
}
thomaux
  • 19,133
  • 10
  • 76
  • 103
dagogodboss
  • 483
  • 1
  • 4
  • 19
0

You can use this CSS:

.unselectable {
   user-select: none;
}
Delan Azabani
  • 79,602
  • 28
  • 170
  • 210