The following doesn't work for firefox. I'm trying delete the table row on click. Can anyone please help. Many thanks.
<INPUT TYPE="Button" onClick="delRow()" VALUE="Remove">
function delRow(){
if(window.event){
var current = window.event.srcElement;
}else{
var current = window.event.target;
}
//here we will delete the line
while ( (current = current.parentElement) && current.tagName !="TR");
current.parentElement.removeChild(current);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…