JavaScript DHTML/Document/all

Материал из Web эксперт
Версия от 10:20, 26 мая 2010; Admin (обсуждение | вклад) (1 версия)
(разн.) ← Предыдущая | Текущая версия (разн.) | Следующая → (разн.)
Перейти к: навигация, поиск

Check if a tag exists

   <source lang="html4strict">

<html> <head> <title>A Simple Page</title> <script language="JavaScript"> function findhead1() {

   var detectElement = document.all("head1");
   if (detectElement == head1) 
   {
       alert("Element \"head1\" exists");
   }

} </script> </head> <body onload="findhead1()">

Heading One

</body> </html>

 </source>