課程
/前端開(kāi)發(fā)
/JavaScript
/JavaScript進(jìn)階篇
我發(fā)現(xiàn) table.appendChild(newtr);和 table.lastChild.appendChild(newtr);作用一樣。加上.lastChild 有何意義?
2016-10-22
源自:JavaScript進(jìn)階篇 9-22
正在回答
可以在不確定最后一個(gè)子節(jié)點(diǎn)是哪個(gè)的時(shí)候用,畢竟有時(shí)候還需要不時(shí)添加子節(jié)點(diǎn)的
wshyzx 提問(wèn)者
舉報(bào)
本課程從如何插入JS代碼開(kāi)始,帶您進(jìn)入網(wǎng)頁(yè)動(dòng)態(tài)交互世界
2 回答為什么要加上lastChild;?
3 回答為什么代碼的最尾要加上.lastChild;?var tbody = document.getElementById('table').lastChild;?
7 回答var tbody = document.getElementById('table').lastChild; 這行.lastchild什么意思
6 回答請(qǐng)問(wèn)document.getElementById('table').lastChild的lastChild是什麼用意呢?
3 回答為什么var table = document.getElementById("table").lastChild要加lastChild?
Copyright ? 2025 imooc.com All Rights Reserved | 京ICP備12003892號(hào)-11 京公網(wǎng)安備11010802030151號(hào)
購(gòu)課補(bǔ)貼聯(lián)系客服咨詢(xún)優(yōu)惠詳情
慕課網(wǎng)APP您的移動(dòng)學(xué)習(xí)伙伴
掃描二維碼關(guān)注慕課網(wǎng)微信公眾號(hào)
2016-10-22
可以在不確定最后一個(gè)子節(jié)點(diǎn)是哪個(gè)的時(shí)候用,畢竟有時(shí)候還需要不時(shí)添加子節(jié)點(diǎn)的