- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to remove disabled attribute using jQuery?
To remove disabled attribute using jQuery, use the removeAttr() method. You need to first remove the property using the prop() method. It will set the underlying Boolean value to false.
Example
You can try to run the following code to learn how to remove disabled attribute using jQuery:
<!DOCTYPE html> <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script> <script> $(document).ready(function(){ $('.disabledCheckboxes').prop("disabled", true); $('.disabledCheckboxes').removeAttr("disabled"); $(document).ready(function(){ $('button').on('click', function() { if (this.hasAttribute("disabled")) { alert('The disabled attribute exists') } else { alert('The disabled attribute does not exist') } }) }); }); </script> </head> <body> <input type="checkbox" class="disabledCheckboxes" disabled> <input type="checkbox" class="disabledCheckboxes" disabled="disabled"> <button class='button'>Result</button> </body> </html>
- Related Articles
- How to enable the “disabled” attribute using jQuery on button click?
- How to remove an attribute from each tag using jQuery?
- HTML disabled Attribute
- HTML disabled Attribute
- HTML disabled Attribute
- HTML disabled Attribute
- HTML disabled Attribute
- How to remove event handlers using jQuery?
- jQuery :disabled Selector
- How to remove all style attributes using jQuery?
- How to remove all CSS classes using jQuery?
- How to remove all CSS classes using jQuery?
- How to change the value of an attribute using jQuery?
- How to set new value for an attribute using jQuery?
- How to remove underline from text hyperlink using jQuery?

Advertisements