On this page http://blog.zacharyvoase.com/2010/11/11/sockets-and-nodes-i/, running the following code in javascript console will throw an Exception.
var div
It appears as though it is expecting that you are trying to add encoded HTML but it's detecting it as malformed.
Does
var div = document.createElement('div'); div.innerHTML = "»"; do what you need?
Per Comment: var dv = document.createElement('div'); dv.innerHTML = "»"; document.getElementById('test').appendChild(dv);
I got the encoded character here.
You're right about » being valid encoded HTML. I can only guess it's a limitation of the browser.