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前端其它相关文章!