JavaScript DHTML/Node Operation/tags

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

"tags()" Example

   <source lang="html4strict">
   

<html> <body> <script language="JavaScript">

   function function1() {
       alert(document.all.tags("p").length);
   }

</script>

This is a sample text.

This is another sample text.

This is another sample text.

This is another sample text.

This is another sample text.

This is another sample text.

This is another sample text.

This is another sample text.

This is another sample text.

This is another sample text.

This is another sample text.

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


     </source>