javascript - Link on a row and link on an anchor inside a row -
i have table entries , each row of table clickable (when click row, goes details page). ok except fact if put anchor on same row, try go anchor's url , after redirect row's attached link.
how can prevent row action using jquery?
<tr class="clickable-row" ...> <td><a href="..."></a></td> </tr> $('.clickable-row').click(function () { document.location = "..."; });
use stoppropagation(); stop default action
$("a").click(function(e){ e.stoppropagation(); // ur work });
description: prevents event bubbling dom tree, preventing parent handlers being notified of event.
Comments
Post a Comment