NOT nesting input inside label acceptable?

Iā€™m currently building my survey form challenge, and nesting input inside label makes it hard for me to design it to my liking.
So, from best practices standpoint is it okay to build it like this :

<label for="name">Name</label>
<input type="text" id="name">

Instead of this :

<label for="name">Name
  <input type="text" id="name">

Probably a stupid question that nobody ask, but thanks for reading. :grin:


if you use for you can avoid nesting them, yes

1 Like

i had the same doubt. i like nesting though. :wink: