How to check link button or not using jquery. This is the link button that I want to test.
<asp:LinkButton Enabled="true" ID="LinkButton2" runat="server">LinkButton</asp:LinkButton>
try this:
var a = $("#LinkButton2").attr("href"); if (a!== undefined) { alert("true"); } else { alert("false"); }
This will work for you
when using attitute id
var isLinkButtonEnabled = $("#LinkButton2[href]") !== undefined ? true : false;
when using attitute classname
var isLinkButtonEnabled = $(".linkClass[href]") !== undefined ? true : false;
You can check it like:
$("#LinkButton2").is(":disabled")
Here you will get the Boolean value based on it, which you can find.