document.all.tags() : all « Document « JavaScript Tutorial






Syntax

document.all.tags(tag)

The tags() method provides a way to retrieve all HTML elements of a particular tag type from the document.all array.

The method returns an array of elements.

<html>
    <a name="Paint"><h2><u>Paint Colors</u></h2></a>
    Red<br>
    Green<br>
    Blue<br>
    Orange<br>
    <hr>
    <script language="JavaScript">
    <!--
    var arrayOfAnchors = document.all.tags("A");

    document.write("<a href='#",arrayOfAnchors[0].name,"'>");   

    document.write(arrayOfAnchors[0].name,"</a>");              

    -->
    </script>
    </html>








14.3.all
14.3.1.document.all
14.3.2.document.all.item()
14.3.3.document.all.tags()
14.3.4.List all elements by reference the document.all
14.3.5.Use document.all(elementId) to get the element