html tutorial - disabled Attribute in HTML - html5 - html code - html form



Disabled attribute in html

Learn html - html tutorial - Disabled attribute in html - html examples - html programs

  • The disabled attribute specifies that the element should be disabled.
  • It is a Boolean attribute.
  • Disabled attribute is inoperative and unclickable.
  • The disabled attribute is used to keep a user from using the element until some other conditions like selecting a checkbox, etc.,

Syntax for disabled attribute in HTML:

<button>disabled</button>

Applies to:

Element Attribute
<button> disabled
<fieldset> disabled
<input> disabled
<keygen> disabled
<optgroup> disabled
<option> disabled
<select> disabled
<textarea> disabled

align Attribute Value:

Value Description
start Elements are aligned starting from the left or top edge of the box.
center Elements are being placed in the center of the box.
end Elements are placed on the right or bottom edge of the box
baseline Value applies to horizontally so that the elements to be aligned in text and the labels are lined up.
stretch Stretched to fit the size of the box.
left Aligned in left edges.
center Aligned in Centered position
right Aligned in right edges.

Sample coding:

Tryit<!DOCTYPE html>
<html>
    <head>
        <title>Wikitechy-disabled</title>
    </head>
    <body>
        <button type="button" disabled>Wikitechy</button>
    </body>
</html>

Code Explanation for disabled attribute in HTML:

disabled Attribute Code Explanation

  1. The disabled attribute is given to deactivate the button click.

Output of disabled attribute in HTML:

disabled Attribute Output

  1. Here the output displays the disable button, which is shown like unclickable function.

Browser Support for disabled attribute in HTML:

Element
<button> Yes Yes Yes Yes Yes
<fieldset> Yes Not supported Yes 7.0 Yes
<input> 1.0 6.0 1.0 1.0 1.0
<keygen> Yes Not supported Yes 6.0 Yes
<optgroup> 1.0 8.0 Yes Yes Yes
<option> 1.0 8.0 1.0 Yes Yes
<select> Yes Yes Yes Yes Yes
<textarea> Yes Yes Yes Yes Yes

Related Searches to disabled Attribute in html