Event 함수
요소.addEventListener(이벤트종류,function(){
이벤트 일어났을때 실행할 내용;
});
->이렇게 인자로 전달된 함수를 콜백함수라고 한다.
click / contextmenu / dbclick / mousedown / mouseenter/
mouseleave / mousemove / mouseover / mouseout /
mouseup / pointerlockchange / pointerlockerror /
select / wheel
DOM(document object model)
window 는 전역객체이며 그 안에 객체 형태인 document 가있다.
그리고 document안에 html을 가지고 있다.
Javascript에서 html을 객체 형태로 가지고 있는 모델을 document라고 하며 window.document와 document 둘다 가능하다.
document 객체는 DOM 트리의 root node에 접근하게 해주는데,
이런식으로 내용을 다 바꿔준다.