Trigger a click event on an inner element

前端 未结 14 633
后悔当初
后悔当初 2020-12-29 07:53

A row in a table where each first cell contains a link needs to be clicked and open a url.

14条回答
  •  暖寄归人
    2020-12-29 08:28

    Have you tried stopping immediate propagation when you click the link?This way you should stop the recursion

    $('a').click(function(e){
        e.stopImmediatePropagation();
        alert('hi');
    });
    

    fiddle here: http://jsfiddle.net/3VMGn/2/

提交回复
热议问题