JavaScript DHTML/Node Operation/contains
Версия от 10:02, 26 мая 2010; (обсуждение)
"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>