Dofactory.com
Dofactory.com

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>

Author: Jack Poorte
Published: Jun 20 2021
Last Reviewed: Sep 30 2023


What's your favorite/least favorite part of Dofactory?


Guides