YouTip LogoYouTip

Att Button Disabled

## HTML ` ``` ### HTML vs. XHTML Differences In XHTML, attribute minimization is forbidden. The `disabled` attribute must be defined with its value explicitly declared: ```xml ``` --- ## Code Examples ### Basic Example This example demonstrates a simple disabled button: ```html ``` ### Dynamic Control with JavaScript This practical example shows how to enable a button only after a user checks a checkbox: ```html


``` --- ## Browser Support The `disabled` attribute is fully supported by all major modern web browsers: * Google Chrome * Mozilla Firefox * Microsoft Edge / Internet Explorer * Safari * Opera --- ## Important Considerations 1. **Styling Disabled Buttons:** You can style disabled buttons in CSS using the `:disabled` pseudo-class: ```css button:disabled { background-color: #cccccc; color: #666666; cursor: not-allowed; } ``` 2. **Accessibility (a11y):** Screen readers will announce a disabled button as "disabled" or "dimmed." However, because disabled elements cannot receive focus, users navigating via keyboard (using the `Tab` key) will skip over them entirely. If you need the button to remain focusable while being inactive, consider using `aria-disabled="true"` instead.
← Att Button FormAtt Body Link β†’