When one option is selected all others should be disabled. This is useful on small screens and to some people with motor disabilities, particularly when targeting small checkboxes and radio buttons. Host meetups. Content available under a Creative Commons license. For double-headed sliders (to set a range), A menu bar dynamically changes content within an application. Show us your results in the comments section. Inclusively Hiding & Styling Checkboxes and Radio Buttons How else is a blind person going to know the field is disabled if they cannot place the disabled field into the keyboard focus? Testing is important part of the process when tinkering with native HTML elements. When present, it specifies that the <input> element should be disabled. The first thing I want to do is make sure that I create a pseudo-element that can act in place of my checkbox. You could certainly use an SVG icon in this case tooIll leave that as homework for you! This Boolean attribute prevents the user from interacting with the button. Time to build our own. This navigation order (and also the reading order for screen readers) is determined by the web page's source code. The <option> s are disabled, but the <select> itself is not. Markup for a single checkbox looks like this: We use a
wrapper to help with custom styles, but other than that the HTML here is standard semantic form markup. How to build accessibility semantics into web patterns and widgets. How a top-ranked engineering school reimagined CS curriculum (Ep. If this attribute isn't set, the button can still be disabled from a containing element, for example