온휠 속성은 요소 위에서 마우스 휠을 위 또는 아래로 굴릴 때 트리거됩니다. 다음 코드를 실행하여 onwheel을 구현할 수 있습니다. 속성 -
예시
<!DOCTYPE html>
<html>
<body>
<h3 id = "myid" onwheel = "mouseWheel()">
This is demo heading.
</h3>
<p>Click above and use mouse wheel to change the heading color.</p>
<script>
function mouseWheel() {
document.getElementById("myid").style.color = "red";
}
</script>
</body>
</html>