View Full Version : outputting character entities

07-08-2005, 01:56 AM
How would one do this?

For example, I was writing a script today that adds some elements to the document. One of these is a text node whose nodeValue I want to include an entity reference. But when the script runs, the text literally reads:

↑ Hide info

So... I am curious to know how I might output the symbol associated with that code instead.

07-08-2005, 02:02 AM
try decode() ?? just a guess?

07-08-2005, 07:16 AM
Use the Unicode Escape Sequences (\uXXXX)

document.createTextNode("\u2191"); //up arrow

To see the complete list of escape sequences for symbols, go here (http://www.unicode.org/charts/symbols.html).