Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
HTML view Event Property
The HTML view Event property returns a cite to the Window object where the event occured.
Syntax
Following is the syntax −
event.view
Example
Let us see an example of HTML view Event Property −
<!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>
Output

Click on “Show view event” button to display Window object −

Now open your console to observe the Window object −

Advertisements