label for html code example

Example 1: how to set text for label in jquery

BY LOVE
$("#lblCustomerName").text('LOVE SINGH');

Example 2: html input label

<!-- By reference -->
<label for="first_name">First Name</label>
<input type="text" id="first_name" name="first_name">

<!-- By wrapping -->
<label>First Name
  <input type="text" name="first_name">
</label>

Example 3: how to use the label tag in html

<label for="id_of_what_you're_labeling"></label>

<!-- for example-->
<label for="username"></label>
<input type="text" id="username">

Example 4: label for attribute

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