[JS, HTML, CSS] 이벤트
·
개발/html, css, js
시작 // 이벤트 함수의 타겟 // 클릭이벤트 window.onclick = function(event){ //event.target은 이벤트가 발생한 요소 //event 태그의 이벤트가 담겨있다. console.log(event.target); event.target; //클래스가 무엇인지로 판단을 해서 이벤트를 적용시킬수도 있다. if(event.target.classList.contains("_target")){ console.log("있어") } //클래스가 무엇인지 가져와서 조건문으로 이벤트를 설정해 줄수 있다. let _class = event.target.className; switch(_class){ case "_target": break; case : break; default: brea..