|
December 2, 2000 Extended Tag Extraction Tips: December 2000
Yehuda Shiran, Ph.D.
|
|
Both Internet Explorer 5 and Netscape 6 claim to be W3C-standard compliant. One supporting evidence is their support of the getElementsByTagName() method, which extracts an array of elements of the same tag type. This method applies to any element. You can extract all tags in a whole document, or in any other elements such a DIV, or a P. The following handleAllTags() function extracts all FONT tags in this tip as well as all tags in the DIV container that wraps the following code listing. It prints these two counts:
DIV with ID="foo" are found by foo.getElementsByTagName("font"). All this tip's tags are extracted by document.getElementsByTagName("font"). This tip has been contributed by Thomas Ashe.
People who read this tip also read these tips: Look for similar tips by subject: |