How do I disable a Bootstrap button after it is clicked using Javascript.
I am using the onclick
event but it doesn't get disabled.
Code:
<div class="panel-heading">
<div class="btn-group pull-right">
<a href="/assign" class="btn btn-success">Assign</a>
<a href="#" class="btn btn-primary" onclick="this.disabled=true">Upload</a>
</div>
</div>
$("#buttonid").on("click", function() {
$(this).prop("disabled", true);
});
add
$(this).prop("disabled",true);
to you click event function
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With