Archive for September, 2009
How to create a space ( ) using the DOM
by admin on Sep.01, 2009, under development, Javascript
This is a problem which stumped me when I first started to experiment with creating elements dynamically. A couple of simple methods I have found to work are:
document.createTextNode(String.fromCharCode(160))
or the Unicode equivalent:
document.createTextNode(‘u00a0‘)
Hope this has been able to solve many a headache!