Is an aria required for radio buttons or flags?

I use the Chrome volume extension to check for availability, and I get a violation on my radio buttons and checkboxes. Looking at the W3C documentation for "aria-required", you can find it here: W3C on demand aria , none of them are specified for the roles used.

According to this question: HTML5: how to use the “required” attribute with the “radio” field , you just need to mark one radio button with the required one. However, I try to use the aria with old browsers, and I get a violation. Elements should only use valid ones ARIA attributes , saying that "aria-required" is not allowed on any of my radio-type inputs or a flag with the required aria.

Is this a mismatch with the tool, does HTML5 need to work a little differently, or does it require an aria that is not actually allowed on the radio or flags?

+5
source share
1 answer

-, aria-required .

fieldset ( aria-required).

 <fieldset aria-required="true">
    <legend>Do you like ARIA? (mandatory question)</legend>
    <input type="radio" name="answer" required="required" value="Yes"/>
    <input type="radio" name="answer" required="required" value="No"/>
 </fieldset>

, aria-required required , .

<div role=radiogroup>, HTML (. )

+8

Source: https://habr.com/ru/post/1620206/


All Articles