3

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);
A1rPun
  • 16,287
  • 7
  • 57
  • 90
user2739418
  • 1,623
  • 5
  • 29
  • 51
  • Here you may find your answer http://stackoverflow.com/questions/5085584/disable-a-hyperlink-using-jquery Hope it helps. – Negom Jun 17 '15 at 13:59

1 Answers1

2

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/

A1rPun
  • 16,287
  • 7
  • 57
  • 90