JQuery: Disable click event

前端 未结 5 2036
梦如初夏
梦如初夏 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:35

    If you want to disable it for any element under that div you must type:

    $('#parent *').click( function(e)
    {
         e.stopPropagation();
         e.preventDefault();
         e.stopImmediatePropagation();
         return false;
    });
    

提交回复
热议问题