Disabling links to stop double-clicks in JQuery

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 them individually.. any ideas? So far I got this: $("a.button").click(function() { $(this).attr("disabled", "disabled"); }); $("a[disabled]").click(function() { return false; }); but the second event isn't firing..
disabled='disabled' isn't a valid attribute for a link

以上就是Disabling links to stop double-clicks in JQuery的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » jQuery 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准