jquery link tag enable disable

后端 未结 3 443
隐瞒了意图╮
隐瞒了意图╮ 2020-12-16 04:17

I want to disable the link during loading, for the code given below

\"<%= f.add_associated_link(\'Add Task\', @project.tasks.bu         


        
3条回答
  •  一整个雨季
    2020-12-16 04:45

    $('#addlink').click(function(e) {
        e.preventDefault();
        //do other stuff when a click happens
    });
    

    return false;

    will prevent the default event from occuring and and also prevent the event from bubbling up

    So chosing between these two depends on your use. If you want to stop the default action and also need to bubble up the event then use preventDefault

提交回复
热议问题