I was checking a few sites, and I came up with the below:
<table class="admin_table">
<thead>
<tr>
<th>Company Name</th>
<th>Industry</th>
</tr>
</thead>
<tbody>
<tr url="/home/companies/1">
<td>Microsoft</td>
<td>Computer Software</td>
</tr>
</tbody>
</table>
$(document).ready(function() {
$(".admin_table tr").not(':first').click(function() {
var url = $(this)..attr("url");
if (url != null && url != '') {
window.location = url;
}
});
});
However, when clicking on the row, it's not responding?
I initially read the following sites for this:
jQuery - Click event on <tr> elements with in a table and getting <td> element values
http://www.electrictoolbox.com/jquey-make-entire-table-row-clickable/
Is there anything I am missing in my code? In many cases the code is identical...
..(two dots) after$(this)?$(this)it works for me. See jsfiddle.net/WbqFj