How do I disable/enable a form element?

Sometimes you need to enable or disable input elements or form elements in jQuery. In such cases, you can use jQuery prop() method to disable or enable input elements/form elements dynamically using jQuery.


Full Source

jQuery 1.5 and below

The jQuery .prop() method doesn't exist jQuery 1.5 and below , in such cases you can use jQuery .attr() method .

It is important to note that, you can always rely on the actual DOM object and is probably a little faster than the above two options if you are only dealing with one element:


In JavaScript you can use the following code to disable/enable an element.

The disabled property sets or returns whether a text field is disabled, or not.

 (C) 2023    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About