[JS] Element 함수 matches()를 이용한 이벤트 추가
❗matches 함수의 기본적인 사용방법 matches 함수는 Element의 내장 메서드입니다. CSS 선택 문자열로 요소의 일치 여부를 판단할 수 있습니다. const element = document.getElementById('myElement'); if (element.matches('.myClass')) { console.log('The element matches the selector'); } else { console.log('The element does not match the selector'); } ❗matches를 이용한 버튼 이벤트 추가 다음과 같이 버튼이 있다고 했을 때, 이벤트를 어떻게 부여할 수 있을까요? btn1 btn2 btn3 기본적으로 순회를 통해서 addEvent..