📜  如何在javascript代码示例中禁用onclick事件

📅  最后修改于: 2022-03-11 15:03:45.433000             🧑  作者: Mango

代码示例1
$("#id").on('click', function(){ //enables click event
    //do your thing here
});

$("#id").off('click'); //disables click event

// If you want to disable a div, use the following code:
$("#id").attr('disabled','disabled');