One potential solution involves using CSS, although it is considered a non-standard feature:
::selection {
background: transparent;
}
::-moz-selection {
background: transparent;
}
Is there a method to achieve the same effect using JavaScript? Additional information on ::selection
can be accessed through caniuse.