Asked • 04/24/19

Should I put input elements inside a label element?

Is there a best practice concerning the nesting of `label` and `input` HTML elements?classic way:<!-- language: lang-html --> <label for="myinput">My Text</label> <input type="text" id="myinput" />or<!-- language: lang-html --> <label for="myinput">My Text <input type="text" id="myinput" /> </label>

1 Expert Answer

By:

Gabriel F. answered • 11/05/19

Tutor
5.0 (85)

Full Stack Software Developer and Mentor

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.