How would I stop the click method from working more than once?
<p>I have a click method on a button + link that animates stuff as a result of the click. However, I want it so that it only works once. I managed to disable the button after it's clicked, so that's good. But I tried <code>.disabled = true</code> on the link and it didn't work. Is there some way I could prevent it from being clicked more than once?</p>

<p>JS</p>

<pre><code>$('#frontbutton, #loginlink').on('click', function(){
    $('.popup').hide();
    usernameInput.val('');
    emailInput.val('');
    passwordInput.val('');
    confirmInput.val('');
    $('.intro').animate({opacity: '0.5'}, 1000).delay(800).animate({
        left: "+=300px"
    });
    setTimeout(function(){
        $('.formholder').show()}, 2000);
    $('.toppic').animate({opacity: '0.5'}, 1000).delay(800).animate({
        top: "+=300px"
    });
    document.getElementById('frontbutton').disabled = true;
});
</code></pre>
