'tags()' Example : tags « Javascript Methods « JavaScript Reference

'tags()' Example

    
<html>
<body>
<script language="JavaScript">
    function function1() {
        alert(document.all.tags("p").length);
    }
</script>
<p>This is a sample text.</p>
<p>This is another sample text.</p>
<p>This is another sample text.</p>
<p>This is another sample text.</p>

<input type="button" value="Number of p elements" onClick="function1();">
</body>
</html>

    
      
      








Related examples in the same category

1.'tags()' Syntax, Parameters and Note
2.'tags()' is applied to