disabled

Jump to: navigation, search

disabled

This page has been flagged with the following issues:

High-level issues:


W3C Candidate Recommendation

Summary

The disabled attribute prevents users from changing, clicking on, or submitting an element.


Applies to html/elements/input

When an element has the disabled attribute set, it appears dimmed and does not respond to user input. Disabled elements do not respond to mouse events or the contentEditable property.

If an element is contained within a disabled (fieldset, the fieldset will override its disabled attribute.

The disabled attribute will prevent javascript click events on the element.

If the disabled element is present without a value (<input disabled>) it will default to true. Other valid values are true and false.

Examples

View live exampleThis shows a basic form, with an email input and a submit button disabled.

HTML

<form role="form">
	<label for="name">Name</label>
	<input type="text" name="name">
	
<label for="email">Email</label> <input type="email" name="email" disabled>
<input type="submit" disabled> <input type="button" value="cancel"> </form>



Compatibility

Desktop

Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?

Mobile

Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?

See also

Related articles

HTML











  • disabled








































… further results

Attribution

This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]