"Keiron Waites" <webmaster@-NOSPAM-sharemonkey.com> writes:
Is there any way to use a variable.innerHTML = ""; instead of text.innerHTML
= "";? It doesn't seem to work for me.
I am sorry, but I can't see what you are trying to do.
The "innerHTML" property is a property of Document Object Model nodes,
not of text strings. You can do
document.getElementById("elemName").innerHTML = "<em>foo</em>";
and you can do
var variable = document.getElementById("elemName");
variable.innerHTML = "<em>foo</em>";
but you can't write
"text string".innerHTML = "<em>foo</em>";
I am afraid you will ahve to be a little more explicit about what you
are trying to do, if we are to be able to help you.
(and as a side note, you can't have a variable called "var". That is
a reserved word in Javascript.)
/L
--
Lasse Reichstein Nielsen -
lr*@hotpop.com
Art D'HTML: <URL:http://www.infimum.dk/HTML/randomArtSplit.html>
'Faith without judgement merely degrades the spirit divine.'