'contains()' Example : contains : Javascript Methods : JavaScript Reference examples (example source code) Organized by topic

JavaScript Reference
C++
PHP


JavaScript Reference  »  Javascript Methods   » [  contains  ]   
 



'contains()' Example

    
<html>
<body>
<script language="JavaScript">
function function1() {
    var m = document.all.myDiv.contains(myB);
    if (m == true){ 
        m = "YES"
    else {
        m = "NO"
    }
    alert(m)
}
</script>
<div id="myDiv" style="width:300; height:100; border:solid; 1px blue">div element<br>
<input id="myB" type="button" value="Is this button contained within the div element?" onclick="function1();">
</div>
</body>
</html>

    
      
      
Related examples in the same category
1.  'contains()' Syntax, Parameters and Note
2.  'contains()' is applied to
























Home| Contact Us
Copyright 2003 - 07 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.