检测鼠标是否在标签上

通过属性控制鼠标是否在该标签上

 

<div onmouseover="mOver(this)" onmouseout="mOut(this)" style="background-color:green;width:120px;height:20px;padding:40px;color:#ffffff;">把鼠标移到上面</div>
<script>
function mOver(obj)
{
obj.innerHTML="谢谢"
}
function mOut(obj)
{
obj.innerHTML="把鼠标移到上面"
}
</script>

 

把鼠标移到上面
posted @ 2013-11-13 16:36  lycan785  阅读(200)  评论(0编辑  收藏  举报