HTML <form> Tag
The <form>
tag in HTML is used to make a form where users can input information.
The <form>
element can have one or more of these form elements:
An HTML form with checkboxes:
An HTML form with radiobuttons:
The <form>
tag in HTML is used to make a form where users can input information.
The <form>
element can have one or more of these form elements:
An HTML form with checkboxes:
An HTML form with radiobuttons:
<!DOCTYPE html> <html> <body> <h1>Form with checkboxes</h1> <form action="/action_page.php" method="get"> <input type="checkbox" name="vehicle1" value="Bike"> <label for="vehicle1"> I have a bike</label> <br> <input type="checkbox" name="vehicle2" value="Car"> <label for="vehicle2"> I have a car</label> <br> <input type="checkbox" name="vehicle3" value="Boat" checked> <label for="vehicle3"> I have a boat</label> <br> <br> <input type="submit" value="Submit"> </form> </body> </html>
<!DOCTYPE html> <html> <body> <h1>Form with radio buttons</h1> <form action="/action_page.php" method="get"> <input type="radio" id="html" name="fav_language" value="HTML"> <label for="html">HTML</label> <br> <input type="radio" id="css" name="fav_language" value="CSS" checked="checked"> <label for="css">CSS</label> <br> <input type="radio" id="javascript" name="fav_language" value="JavaScript"> <label for="javascript">JavaScript</label> <br> <br> <input type="submit" value="Submit"> </form> </body> </html>