JavaScript DHTML/Node Operation/contains

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

"contains()" Example

   <source lang="html4strict">
   

<html> <body> <script language="JavaScript"> function function1() {

   var flag = document.all.myDiv.contains(myB);
   if (flag == true){ 
       flag = "YES"
   } else {
       flag = "NO"
   }
   alert(flag)

} </script>

div element

<input id="myB" type="button" value="Is this button contained within the div element?" onclick="function1();">

</body> </html>


     </source>