Change submit button to a loading image with jquery

后端 未结 9 1128
庸人自扰
庸人自扰 2021-02-06 11:12

On a lot of sites lately, I\'ve seen buttons being replaced with loading/thinking images after they are pressed, to prevent double clicks and make sure the user knows something

9条回答
  •  滥情空心
    2021-02-06 11:51

    Use .replaceWith():

    $(".submitButton").click(function () {
        $(this).replaceWith("");
    });
    

提交回复
热议问题