jquery 给a标签绑定click
一.
<div id="main"> <div class="tab-content"> <div class="container" > <div class="row"> <div class="col-lg-6 col-sm-12 col-md-6"> <table class="table table-responsive table-hover"> <tbody> <caption class="text-primary" >网络书籍</caption> <tr th:each="book : ${resourcesList}"> <td th:text="${book.key}"> </td> <td th:text="${book.value}"> </td> <td><a class="a_click" >下载</a></td> </tr> </tbody> </table> </div > <div class="col-lg-6 col-sm-12 col-md-6" ></div> </div> </div> </div> </div> <script> $(document).ready(function() { $("a[class='a_click']").click(function(){ }); }); </script>
方法二: