MyndPhlyp wrote:
For IE, I can retrieve an array of tags using:
document.all.tags("tagname")
For NS6 & 7 I can use:
document.getElementsByTagName("tagname")
Is there an equivalent for that ancient NS Communicator 4?
No. However, setting the position CSS style explicitly adds
pretty much every tag to the document.layers[] collection. It's
sort of useless though, since you can't directly access or
manipulate the text in that tag.
<body onload="test();">
<b style="position:relative;">Test</b>
<b style="position:relative;">Another Test</b>
<script type="text/javascript">
function test() {
alert(document.layers[0].clip.width + ';' +
document.layers[1].clip.width);
}
</script>
</body>
In Netscape 4.78, you see "30;88", which seems to indicate you
are obtaining the width of the first and second <b>.
You can also access the CSS style of any type of tag using
document.tags.{tagName}, for example
document.tags.H1.color="blue"; Unfortunately, this will not
change the style dynamically, it's only useful at load time (ie -
in the <head></head> before any content actually loads).
--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ -
http://jibbering.com/faq