Menu
Hi,
I have the following code which when the user clicks a button, the text background color should change to red, however nothing is happening!
var sel = content.document.getSelection();
var range = sel.getRangeAt(0);
var newNode = document.createElement(“span”);
newNode.setAttribute(‘style’, ‘background: red’);
range.surroundContents(newNode);
Any ideas? Is the sel.getRangeAt(0) correct?
Thank you as always
Regards