關(guān)于lastChild
慕課網(wǎng)提供的參考代碼中,var tbody = document.getElementById('table').lastChild; 為什么后面要加lastChild,作用是什么,我發(fā)現(xiàn)不加也行啊
慕課網(wǎng)提供的參考代碼中,var tbody = document.getElementById('table').lastChild; 為什么后面要加lastChild,作用是什么,我發(fā)現(xiàn)不加也行啊
2016-12-04
舉報
2016-12-05
如果只有一個可以不加,但是不能保證只有一個,因此獲取的是最后一個,因此加上。理解的對嘛?