第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

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

Uncaught TypeError: Cannot read property 'getElementsByTagName' of null,一直報這個錯,有人遇到一樣的嗎?用google/firefox都試過了

//?獲取class的函數(shù),這是因為getElementByClassName針對IE10之前的無效
function?getByClass(clsName,parent){
???var?oParent=parent?document.getElementById(parent):document,
??????eles=[],
??????elements=oParent.getElementsByTagName('*');

???for?(var?i=0,l=elements.length;i<l;i++){
??????if?(elements[i].className==clsName){
??????????eles.push(elements[i]);
??????}
???}
return?eles;
}

window.onload=drag()

function?drag(){
????var?oTitle=getByClass('login_logo_webqq','loginPanel')[0];
????oTitle.onmousedown=fnDown;

}
//鼠標按下時的函數(shù)
function?fnDown(){
????document.onmousemove=function(event){
?????????event=event||window.event;
?????????document.title=event.clientX+','+event.clientY;
????}
}


正在回答

1 回答

自己搞出來了,大概原因就是需要html先全部加載出來最后才可以取這個元素,把index.html的script標簽放在html中的最后就可以了。。

1 回復 有任何疑惑可以回復我~

舉報

0/150
提交
取消

Uncaught TypeError: Cannot read property 'getElementsByTagName' of null,一直報這個錯,有人遇到一樣的嗎?用google/firefox都試過了

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

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

幫助反饋 APP下載

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

公眾號

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