How can I insert a character entity like &nbsp into a document from Javascript ?

In : Uncategorized, Posted by on Mar.03, 2009

If you want to insert a non-breaking space you can insert it using the
charactor code. Like this:

var nbsp = document.createTextNode( "\u00A0" );
referenceToWhereYouWantIt.appendChild( nbsp );

The url above is to the complete ECMA Spec.

Tags :
No comments for this entry yet...