Stop propagation for all events

前端 未结 4 1474
野性不改
野性不改 2021-01-08 00:38

I am calling e.stopPropagation() on almost every event that I have for my current application. Is there any way to just stop the propagation for every event wit

4条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-08 00:54

    Try this. It requires jQuery.

    $('*').on('click', function(e){
       e.stopPropagation();
    });
    

提交回复
热议问题