latest Post

Disable/Enable an element using jQuery

Disable/Enable an element using jQuery

Approach 1
1
$("#txtName").attr("disabled", true);
Approach 2
1
$("#txtName").attr("disabled", "disabled");
If you wish to enable any element then you just have to do opposite of what you did to make it disable. However jQuery provides another way to remove any attribute.

Approach 1
1
$("#txtName").attr("disabled", false);
Approach 2
1
$("#txtName").attr("disabled", "");
Approach 3
1
$("#txtName").removeAttr("disabled");

About Mallikarjun A

Mallikarjun A
Recommended Posts × +

0 comments:

Post a Comment