How can I select the ::selection
element using JavaScript in order to apply style rules?
document.querySelector("::selection").style.backgroundColor = "red";
Uncaught TypeError: Cannot read property 'style' of null(…)
How can I select the ::selection
element using JavaScript in order to apply style rules?
document.querySelector("::selection").style.backgroundColor = "red";
Uncaught TypeError: Cannot read property 'style' of null(…)