Wuu Posted July 27, 2009 Report Posted July 27, 2009 (edited) function delrow(r,table) { var i=r.parentNode.parentNode.rowIndex; document.getElementById(table).deleteRow(i); } <tr><td><a href="del" onclick="delrow(this,'comment_list'); return false;">Dzēst</a></td></tr> Kaut kas nav kārtība? Laikam this atsaucās uz <a> tāgu? Dzēst dzēš ,bet pašu augšējo! Edited July 27, 2009 by Wuu Quote
0 Val Posted July 27, 2009 Report Posted July 27, 2009 hz, itkā strādā, kā vajag :> <script type="text/javascript"> function delrow(r,table) { var i=r.parentNode.parentNode.rowIndex; document.getElementById(table).deleteRow(i); } </script> <table id="comment_list"> <tr><td><a href="del" onclick="delrow(this,'comment_list'); return false;">Dzēst1</a></td></tr> <tr><td><a href="del" onclick="delrow(this,'comment_list'); return false;">Dzēst2</a></td></tr> <tr><td><a href="del" onclick="delrow(this,'comment_list'); return false;">Dzēst3</a></td></tr> <tr><td><a href="del" onclick="delrow(this,'comment_list'); return false;">Dzēst4</a></td></tr> </table> Quote
Question
Wuu
Kaut kas nav kārtība? Laikam this atsaucās uz <a> tāgu? Dzēst dzēš ,bet pašu augšējo!
Edited by Wuu1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.