Disabling links to stop double-clicks in JQuery

前端 未结 16 791
别跟我提以往
别跟我提以往 2020-12-02 11:13

How would I disable all links with the button class after they are clicked once? I\'d like to be able to do this in one place, and not have to change all of the

16条回答
  •  忘掉有多难
    2020-12-02 12:10

    create a JS - include it on every page (or in your masterpage if you've got one.)

    I think something like

    $(document).ready(function(){
      $('.button').click(function(){
        $('.button').click(function(e) {
          e.preventDefault();
        });
      });
    });
    

提交回复
热议问题