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);
}
function() { delRow(); }. As you can see you won’t be able to see theeventobject indelRow()except when you are in IE because event is in the window object.I suggest you to use javascript library such as jQuery or change your code if you need to keep things relatively the same.