How to Create Checkbox in html

   How to Create Checkbox in html

https://webdesigningtheory.blogspot.com


how to  create html  input type="checkbox">

<input type="checkbox">

A check box allowing multiple values to be  selected.


How to Create Checkbox in html

 program 

<html>

 <body>
<h2>checkbox </h2>

<p> The<strong>input type="checkbox"</strong>

defines a checkbox</p>

<form action="/action_page.php">

 <input type="checkbox" name="vehicle1" value="sports car">

<P>I have sports car</p><br>

<input type="checkbox" name="vehicle2" value="luxury car">

<P>I have a Luxury car</p><br><br>
<input type="submit">
</form>

</body>

</html>

How to Create Checkbox in html

Explain Program

Step 1 ]

<!Doctype html>

  • <!doctype html>  always be the first line of any HTML document.

Step 2 ]

   <html> and </html>

   html  is the root element.

Step 3 ]

<body> and </body>

body  is  main content area.

All visible content inside to  the <body> tag
Step 4]

<form action="/action_page.php">

form submitted data sent to the server-side file action page.php

Step 5]

 <input type="checkbox" name="vehicle1"
value="sports car">

create first checkbox
name = vehicle1 is the identifier use send form data.
value = sport car the server checked

Step 6]

<P>I have sports car</p><br>


first checkbox

Step 7]

<input type="checkbox" name="vehicle2"
value="Luxury Car">

second checkbox 

name= vehicle2  value= Luxury car 
Step 8]
<input type="submit">

submit button (click submit it send data action_page.php

How to Create Checkbox in html

 output 

Checkbox Tag output

Comments

Popular posts from this blog

What Is CSS Text Color in 2026

CSS Padding Property Explained

CSS Outline Color Property in 2026