เมื่อมีการเลื่อนล้อเลื่อนของเมาส์เหนือองค์ประกอบ onwheel ทริกเกอร์แอตทริบิวต์
ตัวอย่าง
คุณสามารถลองเรียกใช้รหัสต่อไปนี้เพื่อรันสคริปต์เมื่อล้อเลื่อนของเมาส์ถูกเลื่อนไปที่องค์ประกอบใน HTML -
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<div id = "myDIV" onwheel = "display()">This is demo text. Roll the mouse wheel here.</div>
<script>
function display() {
alert("Mouse Wheel used!");
}
</script>
</body>
</html>