I have a small test file:
http://jsfiddle.net/9xwUx/1/
The code comes down to the following (given the node with the identifier "target"):
var string = '<div class="makeitpink">this should be pink, but is not</div>';
var parser = new DOMParser();
var domNode = parser.parseFromString(string,"text/xml");
document.getElementById("target").appendChild(domNode.firstChild);
If you run a test file and then test the node target with the firebug / chrome inspector and select any node in the jsfiddle iframe body tag and do "edit as HTML", add a random character anywhere as a string [not the domnode attribute to make it clear] , and save, apply style. but not earlier than that. Saying I'm confused is an understatement.
Can anyone clarify what is going on here? Thank.
source
share