HTML 보기 이벤트 속성은 이벤트가 발생한 Window 개체에 대한 인용을 반환합니다.
구문
다음은 구문입니다 -
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> 출력

'보기 이벤트 표시를 클릭합니다. " 버튼을 눌러 창 개체를 표시합니다. -

이제 콘솔을 열어 Window 개체를 관찰하십시오 -
