TOC PREV NEXT INDEX

Put your logo here!


getElementsByTagName


Returns a list of elements of a given name in the document.

Syntax

elements = document.getElementsByTagName(Name) 

Parameters

elements is a nodeList of elements.

tagName is a string representing the name of the elements.

Example

// check the alignment on a number of tables 
tables = document.getElementsByTagName("table"); 
dump("no. of tables: " + length(tables)); 
for (var i = 0; i < frames.length; i++) { 
   dump(table[i].alignment); 
} 

Notes

Another very useful feature of DOM programming is the getElementsByTagName() method, which returns a nodeList of all the elements with the given name.

Specification

core


mozilla.org | mailto:oeschger | bug 93108
TOC PREV NEXT INDEX