js element1 Javascript 요소 가져오기 HTML DOM Document의 요소를 가져오는 함수들의 정의와 사용법에 대해서 소개합니다. 관련 함수는 아래와 같습니다. getElementById getElementsByClassName getElementsByName getElementsByTagName querySelector querySelectorAll getElementById('아이디') 함수의 인자와 아이디가 일치하는 요소를 가져옵니다. querySelector('#아이디')로 대체 가능합니다. ('#'을 꼭 붙여줍니다.) 꾸션 document.getElementById('blogName') document.querySelect('#blogName') getElementsByClassName('클래스명') 함수의 인자와 클래스가 일치하.. 2022. 6. 27. 이전 1 다음 반응형