JQuery: Disable click event

前端 未结 5 1983
梦如初夏
梦如初夏 2021-01-15 09:56

I want to disable all click events on my page but some of events are still getting called, suppose I have html as below

5条回答
  •  醉梦人生
    2021-01-15 10:44

    Just remove the onclick attribute from elements that have it, and unbind the 'click' event using .off('click') method

    $('#parent *[onclick]').removeAttr('onclick').off('click');
    

提交回复
热议问题