Check Box in HTML
Checkbox is used in html when a users want to select more than one or more option from a set of alternatives. If a user wants to select only one option, user can choose a radio button in html page.
Understand with Example
The Tutorial explains you an example from Checkbox in HTML. In this tutorial code, we create a set of check box, this set of check box can be selected more than one by the user.
<input type> : The HTML page contains <input type>tag define the start of input field in which the data can be entered by the user.
<name> : In this html code, it define a common name for the input element.
<value> :This define the output value of input element in html page, when it is clicked. The Result is sent to the specified form's action URL.
<form action=""> I have a bicycle: <input type="checkbox" name="vehicle" value="bicycle"> I have a bike: <input type="checkbox" name="vehicle" value="bike"> I have a car: <input type="checkbox" name="vehicle" value="car"> I have a bus: <input type="checkbox" name="vehicle" value="bus"> I have a truck: <input type="checkbox" name="vehicle" value="truck"> I have a aeroplane: <input type="checkbox" name="vehicle" value="aeroplane"> </form> |
Defines the result of the input element when clicked. The result is sent to the form's action URL.Save the code with .html extension. Paste the path of html code into a URL of the browser. The output on the browser is displayed as -
User can choice more than one option at a time.
|