0% found this document useful (0 votes)
3 views7 pages

Presentation 1

Uploaded by

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

Presentation 1

Uploaded by

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

The <form> element is a container for different types of

input elements, such as: text fields, checkboxes, radio


buttons, submit buttons, etc.
All the different form elements are covered in this
chapter: HTML Form Elements.

The <input> Element


The HTML <input> element is the most used form element.
An <input> element can be displayed in many ways, depending on
the type attribute.
Type Description
<input type="text"> Displays a single-line text input field
<input type="radio"> Displays a radio button (for selecting one of
many choices)

<input type="checkbox"> Displays a checkbox (for selecting zero or


more of many choices)

<input type="submit"> Displays a submit button (for submitting the


form)

<input type="button"> Displays a clickable button


• Forms collect user input using various elements:
• <input type="text">: Text input.
• <input type="checkbox">: Checkbox.
• <input type="radio">: Radio button.
• <button>: Button.
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="checkbox" id="subscribe" name="subscribe">
<label for="subscribe">Subscribe to newsletter</label>
</form>

Example:
<form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="checkbox" id="subscribe"
name="subscribe">
<label for="subscribe">Subscribe to
newsletter</label>
</form>
<label for="name">Name:</label>
<input type="text" id="name" name="name">
<input type="checkbox" id="subscribe" name="subscribe">
<label for="subscribe">Subscribe to newsletter</label>
</form>

• 2 .HTML5 Input Types Learning Content


• HTML5 introduced new input types:
• email: For email addresses.
• number: For numeric values.
• date: For dates.
1. Text Inputs, Buttons, Checkboxes, and Radios
Learning Content

Example:
<form>
<label for="email">Email:</label>
<input type="email" id="email"
name="email">
<label for="dob">Date of Birth:</label>
<input type="date" id="dob" name="dob">
</form>
1. Text Inputs, Buttons, Checkboxes, and Radios
Learning Content

• The <form> Element


• The HTML <form> element is used to create
an HTML form for user input:
• <form>
• form elements
• </form>

You might also like