- 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
HTML disabled Attribute
The disabled attribute in HTML is used to disable an element. Use this attribute on the following elements −
<button>, <textarea>, <optgroup>, <select>, <fieldset>, <input>, and <option>.
Following is the syntax −
<element disabled>
The above element will get disabled since we have set it disabled.
Let us now see an example to implement the disabled attribute of the <input> element in HTML.
The disabled attribute of the <input> element is used to disable <input> element. When an element is disabled, it becomes unclickable. For obvious reasons, the disabled input element won’t get submitted.
Following is the syntax −
<input disabled>
Let us now see an example to implement the disabled attribute of the <input> element −
Example
<!DOCTYPE html> <html> <body> <h2>Details</h2> <form> <p>These are the new details...</p> <fieldset> <legend>New Details:</legend> Player: <input type="text" disabled><br> Rank: <input type="number"><br> Email: <input type="email"><br> Reporting Time: <input type="time"> </fieldset> </form> </body> </html>
Output
This will produce the following output wherein we have disabled one of the input element “Player” −
- Related Articles
- HTML disabled Attribute
- HTML disabled Attribute
- HTML disabled Attribute
- HTML disabled Attribute
- How to remove disabled attribute using jQuery?
- HTML DOM Textarea disabled Property
- HTML DOM Button disabled Property
- HTML DOM Select disabled Property
- HTML DOM Option disabled Property
- HTML DOM Link disabled Property
- HTML DOM Fieldset disabled property
- HTML DOM Input Button disabled Property
- HTML DOM Input FileUpload disabled Property
- HTML DOM Input Month disabled Property
- HTML DOM Input Number disabled Property

Advertisements