Labels in html

what if I use label like this?
username

    <input type="text" name="username" 

    id="username">

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

Making the <input> element into a label? Why? What does this accomplish?

So the answer to “what if” is… Nothing. You’ll have no label but you will have a text input.

Here’s the proper usage of the label element:

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

This will output your label (Username, as specified between the <label> tags), followed by its associated text input.


Label Tag Documentation: