为什么用lastChild
function deleteRow(obj){
var tbody = document.getElementById('table').lastChild;
var tr = obj.parentNode.parentNode;
tbody.removeChild(tr);
}
为什么不是var tbody = document.getElementById('table');
function deleteRow(obj){
var tbody = document.getElementById('table').lastChild;
var tr = obj.parentNode.parentNode;
tbody.removeChild(tr);
}
为什么不是var tbody = document.getElementById('table');
2015-07-09
举报