87,910
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test</title>
<script>
var currentObj = null;
document.onmouseover=function(){
currentObj = event.srcElement;
};
window.onload = function(){
window.setInterval("showCurrentObj()",5000);
}
function showCurrentObj(){
alert(currentObj.outerHTML);
}
</script>
</head>
<body>
<div id=d1 style="background-color:red">111</div>
<div id=d2 style="background-color:green">222</div>
<div id=d3 style="background-color:yellow">333</div>
<div id=d4 style="background-color:blue">444</div>
</body>
</html>
currentObj = event.srcElement;