I'm tweaking a wysiwyg editor, and I'm trying to create an icon which will strip selected text of h2
.
In a previous version, the following command worked perfectly:
oRTE.document.execCommand("removeformat", false, "");
But in the current version, although that command successfully removes from selected text such tags as bold, underline, italics, it leaves the h2
tag intact.
(Interestingly enough, execCommand("formatblock"...)
successfully creates the h2
tag.)
I'm thinking that I'm going to have to abandon execCommand
and find another way, but I'm also thinking that it will be a lot more than just 1 line of code! Would be grateful for suggestions.