'contains()' Example : contains : Node Operation JAVASCRIPT DHTML TUTORIALS


JAVASCRIPT DHTML TUTORIALS » Node Operation » contains »

 

'contains()' Example



    
<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 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>

    
      
      



-

Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .

Follow Navioo On Twitter

JAVASCRIPT DHTML TUTORIALS

 Navioo Node Operation
» contains