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