意外發現table中利用<a>標簽控制tr的行為無效。
嘗試<a>標簽在table中的使用,只有在<td><a href=""></a><td>的情況下有效。
那么如何實現<tr>標簽的點擊跳轉?使用jquery實現:
1 <table> 2 <tbody> 3 <tr class="jump"> 4 <input type="hidden" href="jump.php"/> 5 <td>1</td> 6 <td>2</td> 7 </tr> 8 </tbody> 9 </table> 10 11 /*jquery部分*/ 12 <script> 13 $(".jump").click(function () { 14 location.href = $(this).children("input").attr("value"); 15 }); 16 </script>