新增选择器
window.onload=function(){
varoDiv=document.querySelector('#div1');
alert(oDiv);//弹出[object HTMLDivElement],表示选择了该Div
//如果要选择多个元素用querySelectorAll
varaLi=document.querySelectorAll('.list li');
alert(aLi.length);//8
}
新增选择器
window.onload=function(){
varoDiv=document.querySelector('#div1');
alert(oDiv);//弹出[object HTMLDivElement],表示选择了该Div
//如果要选择多个元素用querySelectorAll
varaLi=document.querySelectorAll('.list li');
alert(aLi.length);//8
}