getElementById

JavaScript

[JavaScript] document

document .querySelector 클릭 function myFunc(){ var boxList=document.querySelectorAll("#wrap>#box") //#wrap하위의 #box모두 접근 boxList[0].innerText="변경111" boxList[1].innerText="변경222" } function myFunc2(){ var boxList=document.querySelectorAll("#wrap>#box") //#wrap하위의 #box모두 접근 alert(boxList[0].innerText) alert(boxList[1].innerText) } wrap 하위 box로 접근도 가능하고, 배열 안에 넣어서도 사용가능하다. .getElementById 클릭 ID에 의한 ..

Potato Ongsim
'getElementById' 태그의 글 목록