event
event event란? 이벤트에는 다양한 것이 있다. 클릭했을 때 마우스를 가져다 댔을 때 마우스를 땔 때 와이파이 연결을 해제했을 때 드래그 했을 때 등등 여러가지 이벤트가 있다. 그 중 가장 이해하기 쉬운 click 이벤트를 살펴보겠다. Click me! const title = document.querySelector(".hello:first-child h1"); function handleTitleClick() { title.style.color = "blue"; } title.addEventListener("click", handleTitleClick); 세부 내용 const title = document.querySelector(".hello:first-child h1"); title이라는 ..