adding multiple spaces
Hello again,
Does anyone know how to add multiple whitespace characters to a text element in JAvscript?
E.g.,
// get a <p> tag
var p = document.getElemenById("para1");
//this only adds 1 space.
p.appendChild(document.createTextNode(" "));
// this adds literal " "
p.appendChild(document.createTextNode("   ;"));
as does #160;
I'm sure this has an easy solution but it doesn't appear to be in my "Beginning Javsscript" book.
Thanks in advance for any suggestions,
Richard
|