disabled

object disabled extends Attr

option - If this Boolean attribute is set, this option is not checkable. Often browsers grey out such control and it won't receive any browsing event, like mouse clicks or focus-related ones. If this attribute is not set, the element can still be disabled if one of its ancestors is a disabled <a title="The HTML <optgroup> element creates a grouping of options within a <select> element." href="/en-US/docs/Web/HTML/Element/optgroup"><code><optgroup></code></a> element. textarea - This Boolean attribute indicates that the user cannot interact with the control. (If this attribute is not specified, the control inherits its setting from the containing element, for example <a title="The HTML <fieldset> element is used to group several controls as well as labels (<label>) within a web form." href="/en-US/docs/Web/HTML/Element/fieldset"><code><fieldset></code></a>; if there is no containing element with the <code>disabled</code> attribute set, then the control is enabled.) menuitem - Boolean attribute which indicates that the command is not available in the current state. Note that <code>disabled</code> is distinct from <code>hidden</code>; the <code>disabled</code> attribute is appropriate in any context where a change in circumstances might render the command relevant. link - This attribute is used to disable a link relationship. In conjunction with scripting, this attribute could be used to turn on and off various style sheet relationships.

<strong>Note: </strong>While there is no <code>disabled</code> attribute in the HTML standard, there <strong>is</strong> a <code>disabled</code> attribute on the <code>HTMLLinkElement</code> DOM object.

The use of <code>disabled</code> as an HTML attribute is non-standard and only used by some browsers (<a class="external" href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=27677">W3 #27677</a>). <strong>Do not use it</strong>. To achieve a similar effect, use one of the following techniques:

  • If the <code>disabled</code> attribute has been added directly to the element on the page, do not include the <a title="The HTML <link> element specifies relationships between the current document and an external resource. Possible uses for this element include defining a relational framework for navigation. This element is most used to link to style sheets." href="/en-US/docs/Web/HTML/Element/link"><code><link></code></a> element instead;
  • Set the <code>disabled</code> <strong>property</strong> of the <code>StyleSheet</code> DOM object via scripting. keygen - This Boolean attribute indicates that the form control is not available for interaction. fieldset - If this Boolean attribute is set, the form controls that are its descendants, except descendants of its first optional <a href="/en-US/docs/Web/HTML/Element/legend" title="The HTML <legend> element represents a caption for the content of its parent <fieldset>."><code><legend></code></a> element, are disabled, i.e., not editable. They won't receive any browsing events, like mouse clicks or focus-related ones. Often browsers display such controls as gray. optgroup - If this Boolean attribute is set, none of the items in this option group is selectable. Often browsers grey out such control and it won't receive any browsing events, like mouse clicks or focus-related ones. select - This Boolean attribute indicates that the user cannot interact with the control. If this attribute is not specified, the control inherits its setting from the containing element, for example <code>fieldset</code>; if there is no containing element with the <code>disabled</code> attribute set, then the control is enabled. input -

This Boolean attribute indicates that the form control is not available for interaction. In particular, the <code>click</code> event <a class="external" href="https://html.spec.whatwg.org/multipage/forms.html#enabling-and-disabling-form-controls:-the-disabled-attribute">will not be dispatched</a> on disabled controls. Also, a disabled control's value isn't submitted with the form.

Unlike other browsers, Firefox will by default <a class="external" href="https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing">persist the dynamic disabled state</a> of an <code><input></code> across page loads. Use the <code><a href="/en-US/docs/Web/HTML/Element/input#attr-autocomplete">autocomplete</a></code> attribute to control this feature. button -

This Boolean attribute indicates that the user cannot interact with the button. If this attribute is not specified, the button inherits its setting from the containing element, for example <a title="The HTML <fieldset> element is used to group several controls as well as labels (<label>) within a web form." href="/en-US/docs/Web/HTML/Element/fieldset"><code><fieldset></code></a>; if there is no containing element with the <strong>disabled</strong> attribute set, then the button is enabled.

Firefox will, unlike other browsers, by default, <a class="external" href="https://stackoverflow.com/questions/5985839/bug-with-firefox-disabled-attribute-of-input-not-resetting-when-refreshing">persist the dynamic disabled state</a> of a <a title="The HTML <button> element represents a clickable button." href="/en-US/docs/Web/HTML/Element/button"><code><button></code></a> across page loads. Use the <code><a href="/en-US/docs/Web/HTML/Element/button#attr-autocomplete">autocomplete</a></code> attribute to control this feature.

trait Attr
class Object
trait Matchable
class Any

Type members

Classlikes

object tag extends TagElement

Inherited types

type supports[T <: Tag] = AttrPair[attrType] => AttrPair[tagType]
Inherited from
Attr

Value members

Concrete methods

@inline
def :=(v: Boolean): AttrPair[_disabled_attr]
@inline
def :=(v: Option[Boolean]): OptionalAttrPair[_disabled_attr]

Implicits

Implicits

@inline
implicit def boolToPairbuttonApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairfieldsetApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairinputApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairkeygenApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairlinkApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairmenuitemApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairoptgroupApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairoptionApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairselectApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairstarApplied(attrObj: disabled): AttrPair[tag]
@inline
implicit def boolToPairtextareaApplied(attrObj: disabled): AttrPair[tag]