[Javascript] Comparing Strings

Timothy White weirdit at gmail.com
Thu Aug 25 09:25:36 CDT 2005


On 8/25/05, Triche Osborne <wdlists at triche-osborne.com> wrote:
> Timothy White wrote:
> >
> > So what should I use instead of innerHTML?
> >
> 
> Kinda depends on how your XHTML is structured, but let's say you have a
> DIV, thus:
> 
> <div id="replaceThis">Text to be replaced.</div>
> 
> You'd do something like:
> 
> var replacementText = "Hi there!";
> var theNode = document.getElementById(nodeId);
> theNode.firstChild.data = replacementText;

Hmmm. Well that doesn't work cause I want to put HTML in there.
Is there any other way for HTML? Or is it just InnerHTML?
Otherwise I might try formatting the data differently.

Thanks

Tim



More information about the Javascript mailing list