HTML onpageshow 이벤트 속성은 사용자가 웹페이지로 이동할 때 트리거됩니다.
구문
다음은 구문입니다 -
<body onpageshow=”script”></body>
HTML onpageshow 이벤트 Attribute-
의 예를 살펴보겠습니다.예시
<!DOCTYPE html>
<html>
<style>
body {
color: #000;
height: 100vh;
background: linear-gradient(62deg, #FBAB7E 0%, #F7CE68 100%) no-repeat;
text-align: center;
}
</style>
<body onpageshow="showFn()">
<h1>HTML onpageshow Event Attribute Demo</h1>
<script>
function showFn() {
alert("Hey! you are on homepage");
}
</script>
</body>
</html> 출력

"확인을 클릭합니다. ” 버튼을 누르면 HTML 문서의 내용이 표시됩니다.
