The onmouseover เหตุการณ์จะทริกเกอร์เมื่อคุณวางเมาส์เหนือองค์ประกอบใดๆ
ตัวอย่าง
คุณสามารถลองเรียกใช้ตัวอย่างต่อไปนี้เพื่อเรียนรู้วิธีเรียกใช้ฟังก์ชัน JavaScript จากเหตุการณ์ onmouseover
สาธิตสด
<html>
<head>
<script>
<!--
function over() {
document.write ("Mouse Over");
}
function out() {
document.write ("Mouse Out");
}
//-->
</script>
</head>
<body>
<p>Bring your mouse inside the division to see the result:</p>
<div onmouseover="over()" onmouseout="out()">
<h2> This is inside the division </h2>
</div>
</body>
</html>