This is an example of a form control without a label:
<input type="checkbox" name="spice" value="salt" />Hot
Here is the same form control with a label.
<input type="checkbox" name="spice" value="salt" id="hot" /><label for="hot">Hot</label>
Another way to use the label tag is:
<label><input type="checkbox" name="spice" value="salt" />Hot</label>
Note that for the first method, you need to include the id attribute.
No comments:
Post a Comment