Get Elements by tag name and return an array of elements : getElementsByTagName : DOM Node JAVASCRIPT TUTORIALS


JAVASCRIPT TUTORIALS » DOM Node » getElementsByTagName »

 

Get Elements by tag name and return an array of elements

















<html>
<head>
    <title>removeChild() Example</title>
    <script type="text/javascript">
        function removeMessage() {
            var oP = document.body.getElementsByTagName("p")[0];
            document.body.removeChild(oP);
        }
    </script>
</head>
<body onload="removeMessage()">
    <P>A</p>
    <P>B</p>
    <P>C</p>
</body>
</html>







HTML code for linking to this page:

Follow Navioo On Twitter

JAVASCRIPT TUTORIALS

 Navioo DOM Node
» getElementsByTagName