JavaScript Tutorial/DOM Node/getElementsByTagName — различия между версиями

Материал из Web эксперт
Перейти к: навигация, поиск
 
м (1 версия)
 
(нет различий)

Текущая версия на 11:24, 26 мая 2010

Get Elements by tag name and return an array of elements

   <source lang="javascript">

<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()">

A

B

C

</body> </html></source>