Reference: http://www.w3school.com.cn/jsref/met_doc_getelementsbytagname.asp
HTML DOM Document Object
Definition and usage
The getElementsByTagName () method returns a collection of objects with the specified label name.
Grammar
document.getElementsByTagName (tagname)
Description
The getElementsByTagName () method returns elements in the order that they are in the document.
If you pass the special string "*" to the getElementsByTagName () method, it returns a list of all the elements in the document, the order in which they are arranged in the document.
Hints and Notes
Note: Strings passed to the getElementsByTagName () method can be case insensitive.
Instance
"Text/javascript">function getelements () {varX=document.getelementsbytagname ("input"); alert (x.length); }</script>"Myinput"Type="text"Size=" -"/><BR/><input name="Myinput"Type="text"Size=" -"/><BR/><input name="Myinput"Type="text"Size=" -"/><br/><br/><input type="Button"onclick="getelements ()"value="How many input elements?"/></body> (iii) getElementsByTagName method of learning JavaScript