The onwheel
attribute event is triggered
when the mouse wheel is rolled up or down.
The onwheel
attribute is new in HTML5.
<element onwheel="script or Javascript function name">
All HTML elements
onwheel |
Yes | Yes | Yes | Yes | Yes |
<!DOCTYPE html>
<html>
<head>
<style>
#myDIV {<!--from ww w . j ava2 s . co m-->
border: 1px solid black;
}
</style>
</head>
<body>
<div id="myDIV" onwheel="myFunction()">
This is a test. This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test. This is a test.
This is a test. This is a test. This is a test. This is a test. This is a test.
</div>
<script>
function myFunction() {
console.log("wheel");
}
</script>
</body>
</html>