এইচটিএমএল অনহুইল ইভেন্ট অ্যাট্রিবিউটটি ট্রিগার হয় যখন ব্যবহারকারী একটি HTML নথিতে একটি HTML উপাদানের উপর মাউসের চাকা নাড়ান৷
সিনট্যাক্স
নিম্নলিখিত সিনট্যাক্স −
<tagname onwheel=”script”>Content</tagname>
আসুন আমরা HTML অনহুইল ইভেন্ট অ্যাট্রিবিউট -
এর একটি উদাহরণ দেখিউদাহরণ
<!DOCTYPE html>
<html>
<head>
<style>
body {
color: #000;
height: 100vh;
background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;
text-align: center;
padding: 20px;
}
.wheel {
border: 2px solid #fff;
padding: 10px;
}
</style>
</head>
<body>
<h1>HTML onwheel Event Attribute Demo</h1>
<p onwheel='wheelFn()' class='wheel'>This is a paragraph with some dummy content.
This is a paragraph with some dummy content. This is a paragraph with some dummy content.
This is a paragraph with some dummy content. This is a paragraph with some dummy content.
This is a paragraph with some dummy content. This is a paragraph with some dummy content.
This is a paragraph with some dummy content.</p>
<p>Move the wheel of the mouse up or down on above paragraph</p>
<script>
function wheelFn() {
document.body.style.background = "linear-gradient(45deg, #8BC6EC 0%, #9599E2 100%) no-repeat";
document.body.style.color = "#fff";
}
</script>
</body>
</html> আউটপুট

অনহুইল ইভেন্ট অ্যাট্রিবিউট কীভাবে কাজ করে তা পর্যবেক্ষণ করতে এখন অনুচ্ছেদ উপাদানে মাউসের চাকা উপরে বা নিচে নিয়ে যান।
