Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR HTML

How to link a label and an input

<!-- 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' 
-->
 
PREVIOUS NEXT
Tagged: #How #link #label #input
ADD COMMENT
Topic
Name
3+7 =