onload 사용 요소 로드가 완료되면 스크립트를 실행하는 속성입니다.
예시
다음 코드를 실행하여 onload 속성을 구현할 수 있습니다. −
<!DOCTYPE html>
<html>
<head>
<script>
function display() {
alert("Welcome!");
}
</script>
</head>
<body onload = "display()">
<h3>Welcome to the website.</h3>
<p>We offer learning content.</p>
</body>
</html>