본문 바로가기
FrontEnd/JavaScript

[ JavaScript ] onload() vs addEventListener(load,f)

by ウリ김영은 2023. 10. 25.
onload() addEventListener(load, )
attach event handler to the 'load' event of a web page or an image
can only handle one event handler at a time can attach multiple event handlers
  removeEventListener()
allow to remove the event listener later on
can free up resources &
prevent executing multiple times