
onload가 아닌 load 파라메터를 넘겨주어야 한다.
https://developer.mozilla.org/en-US/docs/Web/API/Window/load_event
Window: load event - Web APIs | MDN
The load event is fired when the whole page has loaded, including all dependent resources such as stylesheets and images. This is in contrast to DOMContentLoaded, which is fired as soon as the page DOM has been loaded, without waiting for resources to fini
developer.mozilla.org
https://developer.mozilla.org/ko/docs/Web/API/EventTarget/addEventListener
EventTarget.addEventListener() - Web API | MDN
EventTarget 인터페이스의 addEventListener() 메서드는 지정한 유형의 이벤트를 대상이 수신할 때마다 호출할 함수를 설정합니다.
developer.mozilla.org
https://opentutorials.org/course/1375/6761
addEventListener() - 생활코딩
addEventListener은 이벤트를 등록하는 가장 권장되는 방식이다. 이 방식을 이용하면 여러개의 이벤트 핸들러를 등록할 수 있다. var t = document.getElementById('target'); t.addEventListener('click', function(event){ ale
opentutorials.org