使用jquery删除链接所在的行
<!doctype html> <html> <head> <meta charset="utf-8"> <title>jquery 删除链接所在行</title> <style type="text/css"> table { border-collapse: collapse; } td { border: solid 1px red; width: 100px; height: 28px; text-align: center; vertical-align: middle; } </style> <script src="jquery-3.2.1.min.js"></script> <script> $(function(){ //为删除链接注册事件 $("a[title='删除']").click(function(){ $(this).parents('tr:first').remove();; }); }); </script> </head> <body> <table width="200"> <tr> <td>1</td> <td> </td> <td> </td> <td><a href="#" title="删除">删除</a></td> </tr> <tr> <td>2</td> <td> </td> <td> </td> <td><a href="#" title="删除">删除</a></td> </tr> <tr> <td>3</td> <td> </td> <td> </td> <td><a href="#" title="删除">删除</a></td> </tr> <tr> <td>4</td> <td> </td> <td> </td> <td><a href="#" title="删除">删除</a></td> </tr> <tr> <td>5</td> <td> </td> <td> </td> <td><a href="#" title="删除">删除</a></td> </tr> </table> </body> </html>