代码示例:(标识:event_onmouseenter)
<!DOCTYPE html>
<html>
<body>

<img onmouseenter="bigImg(this)" onmouseleave="normalImg(this)" border="0" src="/static/demo/images/smile.gif" alt="Smiley" width="128" height="128">

<p>当用户将鼠标指针移动到图像上时会触发函数 bigImg()。</p>
<p>当鼠标指针移出图像时会触发函数 normalImg()。</p>

<script>
function bigImg(x) {
  x.style.height = "256px";
  x.style.width = "256px";
}

function normalImg(x) {
  x.style.height = "128px";
  x.style.width = "128px";
}
</script>

</body>
</html>
运行结果: