Skip to content

Instantly share code, notes, and snippets.

@1Copenut
Last active August 1, 2017 20:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 1Copenut/adcfe268bac6df307a769d70aeb35136 to your computer and use it in GitHub Desktop.
Save 1Copenut/adcfe268bac6df307a769d70aeb35136 to your computer and use it in GitHub Desktop.
a11y - Form - Required radio button group
<h1 id="radio-group-title">A Decent Way to Group Radio Buttons</h1>
<form action="#" aria-labelledby="radio-group-title">
<fieldset role="radiogroup" aria-required="true">
<legend>This fieldset is required</legend>
<label>
<input type="radio" name="test-group" id="test-group-1" required="true" value="true">Yes
</label>
<label>
<input type="radio" name="test-group" id="test-group-2" required="true" value="false">No
</label>
</fieldset>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment