本文共 745 字,大约阅读时间需要 2 分钟。
- <!DOCTYPE HTML>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
- <title>moban</title>
- <script src="http://www.w3school.com.cn/jquery/jquery.js"></script>
- <script type="text/javascript">
- function showzhi(obj){
- var x = $(obj).parent().parent().find("td");
- var y = x.eq(1).text()
- alert(y);
- };
-
- </script>
- </head>
-
- <body>
- <table width="80%" border="1">
- <tr>
- <td>111</td>
- <td>aaa</td>
- <td>ddd</td>
- <td><a οnclick="showzhi(this)">保存</a></td>
- </tr>
- <tr>
- <td>222</td>
- <td>bbb</td>
- <td>eee</td>
- <td><a οnclick="showzhi(this)">保存</a></td>
- </tr>
- <tr>
- <td>333</td>
- <td>ccc</td>
- <td>fff</td>
- <td><a οnclick="showzhi(this)">保存</a></td>
- </tr>
- </table>
- </body>
- </html>
转载于:https://www.cnblogs.com/austinspark-jessylu/p/7652483.html