How can I disable highlighting in html or JS?
You can use the CSS pseudo class selector ::selection
and ::-moz-selection
for Firefox.
For example:
::-moz-selection {
background-color: transparent;
color: #000;
}
::selection {
background-color: transparent;
color: #000;
}
.myclass::-moz-selection,
.myclass::selection { ... }
The CSS3 solution:
user-select: none;
-moz-user-select: none;
There is also a webkit prefix for the user-select, but it makes some form fields impossible to focus (could be a temporary bug), so you could go with the following pseudo-class for webkit instead:
element::selection