Prevent table row onclick event to fire when clicking button inside the row

前端 未结 4 670
后悔当初
后悔当初 2021-02-01 17:01

I have a table row with ONCLICK event (that toggles additional data below). Inside one of the row cells I have a button (when clicked is performing an AJAX action). When I click

4条回答
  •  青春惊慌失措
    2021-02-01 17:23

    Add an event.stopPropagation(); to your buttons click handler. For more information, have a look here and here.

提交回复
热议问题