I have a table...
<table class="data-table">
<thead>
<tr>
<th width="16">ID</th>
<th>Name</th>
<th>Reference</th>
<th>Link</th>
<th>YouTube</th>
<th>Status</th>
<th width="16">Delete</th>
</tr>
</thead>
<tbody>
<tr class="clickable" data-href="/videos/1/">
<td>1</td>
<td>Test Video</td>
<td></td>
<td></td>
<td></td>
<td>
<a href="/videos/delete/1"
onclick="return confirm_delete();">
Delete
</a>
</td>
</tr>
</tbody>
</table>
And the script is...
<script>
function confirm_delete() {
var result = confirm("Are you sure you want to delete this video?");
return result;
}
</script>
Clicking the row takes to the correct URL. Clicking the Delete link asks for confirmation. If I select OK, it takes to the correct delete URL, but if I select Cancel, it cancels the delete URL but takes to the row-level URL. How can I prevent that?