How can I retrieve the element that is created to wrap text with a highlighted background when using document.execCommand('BackColor', false, color)
(or 'HiliteColor'
)? For reference, I'm using Tim Down's solution to highlight selected text: https://stackoverflow.com/a/2583895/494954.
I know I could get a node in the selection, and go up the chain until I found an element that has the background color that I specified, but I'm wondering if there's a more elegant solution?