最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時綁定郵箱和手機(jī)立即綁定

反復(fù)檢查,不知道哪里錯了

window.onload?=?function(){
??waterfall('main','box');

}

function?waterfall(parent,box){
??//將main下所有class=box的元素取出來

??var?oParent?=?document.getElementById(parent);
??var?oBox?=?getbyclass(oParent,box);
??console.log(oBox.length);


}
function?getbyclass(parent,clsname){

??var?boxarr?=?[];//用來存儲所有class?=?box?的元素
?????
?????oElements?=?parent.getElementsByTagName("*");
?????for?(var?i?=?0;?i?<?oElements.length;?i++)?{
???????if?(oElements[i].className?==?clsname)?{
??????????boxarr.push(oElements[i]);
???????}
?????}
?????return?boxarr;
}

報錯:

Uncaught?TypeError:?Cannot?read?property?'getElementsByTagName'?of?null
????at?getbyclass?(index.js:18)
????at?waterfall?(index.js:10)
????at?window.onload?(index.js:2)


正在回答

2 回答

第十一行 box 是字符串

0 回復(fù) 有任何疑惑可以回復(fù)我~
#1

葡萄3 提問者

·是我html里面····沒寫main盒子的id。。。
2017-07-21 回復(fù) 有任何疑惑可以回復(fù)我~

。。。。知道哪里錯了

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報

0/150
提交
取消

反復(fù)檢查,不知道哪里錯了

我要回答 關(guān)注問題
微信客服

購課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號