Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

HTML <input> disabled Attribute

The disabled attribute on an  input  tag disables the input element.

It is grayed out and is unusable.

Example

#

An <input> element with a disabled attribute.
The input field is not usable and its value is not included during form submission.



<form action="/tutorial/action.html">
  <label for="name">Name</label>
  <input disabled type="text" id="name" name="name"><br /><br />
  
  <input type="submit">
</form>

Using disabled

The disabled attribute specifies that the input element is disabled.

The input element appears grayed out and is unusable.

Disabled input elements are excluded from form submission.


Syntax

<input disabled>
or
<input disabled="disabled">

Values

#

Value Description
disabled Use value 'disabled' or no value at all. Both are valid.

Browser support

Here is when disabled support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <input>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides