I have a table. This is the sample code for it.
<table>
<thead>
<tr>
<td>filename</td>
<td>file size</td>
<td>date</td>
</tr>
</thead>
<tbody>
<tr>
<td>
<input type="checkbox">
file 1
</td>
<td>
1MB
</td>
<td>
13-01-12
</td>
</tr>
<tr>
<td>
<input type="checkbox">
file 2
</td>
<td>
2MB
</td>
<td>
23-12-17
</td>
</tr>
</tbody>
</table>
I have a check box input at each row to select multiple tr in tables. I also need to get redirected to the detail view of the file onclick. so, this is my JS code
$(document).on("click", "table tbody tr", function() {
window.location = $(this).data('href');
});
Now whenever I am trying to click the check box the tr is getting clicked. So, the page is getting redirected to another page. But select is not working. How to prevent page redirection on clicking on select.
Thanks in advance
UPDATE::
I want to implement functionality like Inbox mails in gmail. Whenever I click on any of the mail, it gets opened. If I check the checkbox the corresponding mail will be selected.