A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://webplatform.github.io/docs/html/attributes/disabled below:

disabled · WebPlatform Docs

disabled Summary

Prevents users from changing, clicking on, or submitting an element.

Applies to [html/elements/input](/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](/html/attributes/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.

Affects

When this is present a user cannot make the element active. Further, when the form is submitted, the input’s name and value will not be present. If you wish to submit the value, but make it so the user cannot manipulate the value see the readonly attribute.

Examples

This shows a basic form, with an email input and a submit button disabled.

<!doctype html>
<title>Disabled attribute demo</title>
<form role="form">
    <label for="name">Name</label>
    <input name="name">
    <br>
    <label for="email">Email</label>
    <input type="email" name="email" disabled>
    <br>
    <input type="submit" disabled>
    <input type="button" value="cancel">
</form>

View live example

Attributions

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4