Re: simple SPAN Question

by Peter-Paul Koch <ppk(at)xs4all.nl>

 Date:  Wed, 27 Sep 2000 21:42:56 +0200
 To:  hwg-languages(at)hwg.org
  todo: View Thread, Original
><SPAN id="aTag"> Text goes here </SPAN>
>......
>
><script language="Javascript">
>    alert(document.aTag.value)
></script>
>
>How could I get that alert to return me "Text goes here"?

NN4: you can't (unless you give the SPAN a position: absolute, which kind
of defeats the purpose of the tag)
IE4/5: document.all['aTag'].innerText
NN6 (and IE5 too): document.getElementById('aTag').childNodes[0].nodeValue
(assuming there's *only* text inside the SPAN).

ppk

HWG: hwg-languages mailing list archives, maintained by Webmasters @ IWA