How to suppress Click event on when clicking on the button on the ?

后端 未结 3 620
时光取名叫无心
时光取名叫无心 2021-01-15 00:36

I have a click event on the table row that executes an action. However when I click on the button on the same row, I would like to prevent the on-row-click event and simply

3条回答
  •  梦毁少年i
    2021-01-15 01:00

    You can just add a return false; in the click

    $(this).find(".my_btn").off('click').on('click', function () {
      alert("clicked");
      return false;
    })
    

    http://jsfiddle.net/VhYdD/4/

提交回复
热议问题