Wrap Radio Buttons in a Fieldset Element


PHOTO EMBED

Tue Dec 22 2020 00:19:40 GMT+0000 (UTC)

Saved by @Webucation1 #html

<form>
  <fieldset>
    <legend>Choose one of these three items:</legend>
    <input id="one" type="radio" name="items" value="one">
    <label for="one">Choice One</label><br>
    <input id="two" type="radio" name="items" value="two">
    <label for="two">Choice Two</label><br>
    <input id="three" type="radio" name="items" value="three">
    <label for="three">Choice Three</label>
  </fieldset>
</form>
content_copyCOPY

freecodecamp - It is not necessary to wrap radio buttons if the choices are self-explanatory. Using "label" with a "for" attribute is sufficient.

https://www.freecodecamp.org/learn/responsive-web-design/applied-accessibility/wrap-radio-buttons-in-a-fieldset-element-for-better-accessibility