问题
How do I disable a font-awesome button in jQuery?
<a id="btnOK" class="btn btn-primary btn-sm" href="#">
<i class="fa fa-upload"></i> OK
</a>
jQuery is not disabling this button when I try this:
$("#btnOK").prop("disabled", false);
回答1:
You can try something like this:
<button id="btnOK" class="btn btn-primary btn-sm" href="#">
<i class="fa fa-upload"></i> OK
</button>
$(document).ready(function(){
alert("Ready");
$("#btnOK").attr("disabled", "disabled");
$("#btnOK").click(function(){
alert("Ok clicked");
});
});
https://jsfiddle.net/ureyzea1/
来源:https://stackoverflow.com/questions/30891858/how-to-disable-a-font-awesome-button-in-jquery