<!-- 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>
<label for="id_of_what_you're_labeling"></label>
<!-- for example-->
<label for="username"></label>
<input type="text" id="username">
<!DOCTYPE html>
<html>
<head>
<title>Title of the document</title>
</head>
<body>
<form>
<label for="lfname">First name:</label>
<input id="lfname" name="fname" type="text" />
</form>
</body>
</html>
<!-- Implicit -->
<label>First Name
<input type="text" name="first_name" />
</label>
<!-- Explicit -->
<label for="firstName">First Name</label>
<input type="text" id="firstName" name="first_name">
<!--
Note: the 'for' attribute is mapped to the 'id' and NOT name or type
So if id='BobSponge', then for='BobSponge'
-->
<!-- how to use label element in form in html -->
<form action="/example.html" method="POST">
<h1>Login to to your Account</h1>
<label for="username">Username</label>
<input type="text" name="username" id="username">
</form>