87,910
社区成员
发帖
与我相关
我的任务
分享
<script>
function test()
{
alert("hello World!");
}
</script>
<div onmouseout="test()">
<img src="1.jpg" alt="">
<p>hello</p>
</div>
<script>
if(typeof(HTMLElement)!="undefined")
HTMLElement.prototype.contains=function(obj)
{
if(obj==this)return true;
while(obj=obj.parentNode) if(obj==this) return true;
return false;
}
function doit(evt){
evt = window.event?window.event:evt;
var obj = evt.toElement || evt.relatedTarget
if(document.getElementById("divPromptBox").contains(obj)) return;
alert('');
}
</script>
<div id="divPromptBox" class="PromptBox" style="width:50%;background:#ccc" onmouseout="doit(event);">
<a href="#">... </a>
<div>... <div>
<span>... </span>
</div>