jQuery/HTML - Disable OnClick

前端 未结 7 1012
面向向阳花
面向向阳花 2020-12-20 00:29

as the title says I\'m trying to disable OnClick for specific

7条回答
  •  爱一瞬间的悲伤
    2020-12-20 00:45

    You can add off("click");

    Fiddle

    $(function () {
        $("#test").click(function(){alert('test');});
        $("#test").off('click');
    
    });
    

    this code will demonstrate removing a previously added click event.

提交回复
热议问题