এইচটিএমএল ভিউ ইভেন্ট প্রপার্টি উইন্ডো অবজেক্টে একটি উদ্ধৃতি প্রদান করে যেখানে ঘটনাটি ঘটেছে।
সিনট্যাক্স
নিম্নলিখিত সিনট্যাক্স −
event.view
উদাহরণ
আসুন আমরা HTML ভিউ ইভেন্ট প্রপার্টি -
এর একটি উদাহরণ দেখি<!DOCTYPE html>
<html>
<style>
body {
color: #000;
height: 100vh;
background-color: #FBAB7E;
background-image: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%);
text-align: center;
}
.btn {
background: #db133a;
border: none;
height: 2rem;
border-radius: 2px;
width: 40%;
display: block;
color: #fff;
outline: none;
cursor: pointer;
margin: 1rem auto;
}
</style>
<body>
<h1>HTML view Event Property</h1>
<button class="btn" onclick="get()">Show view event</button>
<div class="show"></div>
<script>
function get() {
document.querySelector(".show").innerHTML = "Open your console and observe the Window object";
console.log(event.view);
}
</script>
</body>
</html> আউটপুট

“দেখুন ইভেন্ট দেখান-এ ক্লিক করুন উইন্ডো অবজেক্ট প্রদর্শনের জন্য ” বোতাম -

এখন উইন্ডো অবজেক্ট −
দেখতে আপনার কনসোল খুলুন
