Shoutbox

I need JScript DOM help. - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: I need JScript DOM help. (/showthread.php?tid=77004)

I need JScript DOM help. by Baggins on 08-25-2007 at 03:53 PM

code:
<html>
<body>

<div>1</div>
<div>2</div>
<div>3</div>
<div>4</div>

<script language="Javascript">                   

var x = document.getElementsByTagName("div");
for (i=0;i<x.length;i++)
  {
      document.write(x[i].text.nodeValue);
  }
</script>

</body>
</html>


This should make a page that looks like
1
2
3
4
1234

but all i get is

1
2
3
4

i am using firefox 2.0.0.4, what's wrong?
RE: I need JScript DOM help. by Mnjul on 08-25-2007 at 06:12 PM

How about using x[i].innerHTML ?


RE: I need JScript DOM help. by Baggins on 08-25-2007 at 06:19 PM

It works, thanks Mnjul :>