2014-09-25 85 views
0

我的javascript功能在Google Chrome中不起作用。我打電話使用的onclick按鈕 我的代碼是在這裏Javascript刪除html表格的行在Google Chrome中不起作用

function remove(t) 
{ 
    var orw=t.parentElement.parentElement;  

    document.all('tbl').deleteRow(orw.rowIndex); 

} 
+3

是否在其他瀏覽器這個功能呢?你檢查了控制檯是否有錯誤信息? – nnnnnn 2014-09-25 07:19:59

+0

只在Internet Explorer中 – ram 2014-09-25 07:20:57

+1

總是試圖給出正確的問題,然後只有社區可以幫助。 – 2014-09-25 07:21:13

回答

0

使用

var orw=t.parentElement.parentElement;  


document.getElementById("tbl").deleteRow(orw.rowIndex);//orw.rowIndex is the row index which you want to remove