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

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -