【JavaScript】二重クリック、連打防止

button
ボタンクリック時にdisabledにする。この場合にはattrではなく、propを使うのが良さそう。
<button class="hoge"></button>
$(.hoge).on('click', function(){
$(.hoge).prop('disabled', true);
});
aタグ
リンクの場合には以下のように。alertを入れてやっても良い。
<a class="hoge"></a>
$(.hoge).on('click',function(){
return false;
});
$(.hoge).on('click',function(){
alert('不正操作');
return false;
});