ITSourceCode.com

We Exist to Provide 100% Free Source Code and Tutorials

Custom Search

24-HTML Checkbox

Checkboxes are used by users who like to select multiple option just like an example of a “check all” question.

 

 

Example:

<p>Please select the sport/s that you have played.</p>

Table Tennis: <input type=”checkbox” name=”sport” value=”table tennis” /><br />

Tennis: <input type=”checkbox” name=”sport” value=”tennis” /><br />

Volleyball: <input type=”checkbox” name=”sport” value=”volleyball” /><br />

Baseball: <input type=”checkbox” name=”sport” value=”baseball” />

 

 

 

Example on how to set a checkbox with  a default checked every time the HTML page is loaded:

<p>Please select the sport/s that you have played.</p>

Table Tennis: <input type=”checkbox” name=”sport” value=”table tennis”  checked=”yes”/><br />

Tennis: <input type=”checkbox” name=”sport” value=”tennis”   /><br />

Volleyball: <input type=”checkbox” name=”sport” value=”volleyball”   /><br />

Baseball: <input type=”checkbox” name=”sport” value=”baseball”    checked=”yes”/>

 

Facebook Comments

Check Your Domain Ranking

Leave a Reply

Your email address will not be published. Required fields are marked *

ITSourceCode.com © 2016 Frontier Theme

Subscribe For Latest Updates

Signup for our newsletter and get notified when we publish new articles for free!