Tell us what’s happening:
I understand the value of label and fieldset elements as they pertain to screen-readers. They give semantic meaning and allow for screen-readers to navigate between the form inputs. However, I’d like to know if it’s bad-practice to wrap label and input elements in a div like this:
<!DOCTYPE html>
<html>
<body>
<form>
<fieldset>
<legend>Personalia:</legend>
<div>
<label for="name">Name:</label>
<input id= "name" type="text">
</div>
<div>
<label for="email">Email:</label>
<input type="email" id="email" />
</div>
<div>
<label for="birth">Date of birth:</label>
<input type="text" id="birth" />
</div>
</fieldset>
</form>
</body>
</html>
Is this a bad practice for accessibility? thank you!
Your browser information:
User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36
.