Document Object Model, Application Programming Interface
JS 에서 HTML 을 제어하는 명령들!
const box = document.queryselector('.box');
// Handler
box.addEventListener('click', function() {
~~
}
// 요소의 클래스 정보 객체 활용
box.classList.add('active');
let isContain = box.classList.contains('active'); // true
box.classList.remove('active');
isContain = box.classList.contains('active'); // false