0% found this document useful (0 votes)
5 views

Checkbox

Uploaded by

vanshthakral2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Checkbox

Uploaded by

vanshthakral2004
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

HTML <input type=”checkbox”>


The HTML <input type=”checkbox”> creates a checkbox input


element. It displays as a square box, checked when activated.
Checkboxes enable users to select one or more options from a
limited set of choices.
Syntax
<input type="checkbox">
Example: In this example, we will demonstrate using the HTML
<input type=”checkbox”> element.
html
<!DOCTYPE html>
<html>

<head>
<title>
HTML Input Type Checkbox
</title>

<style>
h2 {
text-align: center;
}

fieldset {
width: 250px;
margin: auto;
}
</style>
</head>

<body>
<h2>HTML &lt;input type="checkbox"&gt;</h2>

<form action="#">
<fieldset>
<legend>Select Your Subjects:</legend>

<input type="checkbox"
name="check"
id="checkbox1"
value="html" checked>
<label for="checkbox1">HTML</label>
<br>

<input type="checkbox"
name="check"
id="checkbox2"
value="css">
<label for="checkbox2">CSS</label>
<br>

<input type="checkbox"
name="check"
id="checkbox3"
value="javascript">
<label for="checkbox3">JavaScript</label>
</fieldset>
</form>
</body>

</html>
Output

You might also like