HTML - Checkbox
Checkboxes, as we said in a previous tutorial, are part of the applications that the input tag offers.
What is different from the previous tutorial is that we will look more into the subject this time.
Checkbox - Creating the lists
The checkboxes come in the help of the user, easing up the choosing simultaneously of more than one answer.
<p>Chouse your favorite colors .</p> Blue: <input type="checkbox" name="colors" value="blue" /><br /> Yellow: <input type="checkbox" name="colors" value="yellow" /><br /> Red: <input type="checkbox" name="colors" value="red" /><br /> Green: <input type="checkbox" name="colors" value="green" /> |
|---|
Chouse your favorite colors . Blue:Yellow: Red: Green: |
|---|
Checkbox - Default selected boxes '
Checkboxes also offer the possibility of being already checked in order to ease up the user's work in some situations.
This thing is done with the help of the checked attribute, with the yes value.
<p>Chouse your favorite colors .</p> Blue: <input type="checkbox"checked="yes" name="colors" value="blue" /><br /> Yellow: <input type="checkbox" name="colors" value="yellow" /><br /> Red: <input type="checkbox" name="colors" value="red" /><br /> Green: <input type="checkbox" checked="yes" name="colors" value="greene" /> |
|---|
Chouse your favorite colors . Blue:Yellow: Red: Green: |
|---|
You can try to play with this application a little. It is quite simple but very
useful in my opinion.
