English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The disabled attribute is a boolean attribute, the disabled input element cannot be used and cannot be clicked, if present, it specifies which <input> element should be disabled.
HTML form with disabled input field:
!DOCTYPE html <html> <head> <title>HTML: <input> disabled attribute - Basic Tutorial Website(oldtoolbag.com)</title> <body> <form action="action_page.php"> First name: <input type="text" name="fname"><br> Last name: <input type="text" name="lname" disabled><br> <input type="submit" value="Submit"> </form> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
All major browsers support the disabled attribute.
The disabled attribute is a boolean attribute.
If present, it specifies the <input> element that should be disabled.
Disabled input elements are not usable and cannot be clicked.
You can set the disabled attribute to prevent users from using the <input> element until certain other conditions are met (such as checking a checkbox, etc.). Then, JavaScript can remove the disabled value and make the <input> element available.
Tip: Disabled <input> elements in forms will not be submitted!
Note:The disabled attribute does not apply to <input type="hidden">.
None.
In XHTML, attribute shorthand is prohibited, the disabled attribute must be defined as <input disabled="disabled" />.
<input disabled>HTML <input> tag