Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>foobar</title>
- <script type="text/javascript" src="js/jquery.js" language="javascript"></script>
- <meta http-equiv="Content-type" content="text/html;charset=UTF-8">
- <style type="text/css">
- tr {
- cursor: pointer;
- display: block;
- border: 1px solid #ff0000;
- }
- </style>
- <script type="text/javascript">
- (function($){
- $(document).delegate('table tr', 'click', function(e){
- $('a', this).trigger('click');
- });
- $(document).delegate('tr a', 'click', function(e){
- console.log("it works!");
- //e.stopPropagation(); // use this if you want normal click behaviour without stackoverflow
- return false; // use this if you don't want normal click behaviour and no propagation
- });
- })(jQuery);
- </script>
- </head>
- <body>
- <table class="table-list">
- <tbody>
- <tr>
- <td>...</td>
- <td><a href="/link">Link</a></td>
- </tr>
- </tbody>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement