0% found this document useful (0 votes)
2 views14 pages

Session5 HTML Jr

This document provides an overview of HTML forms, detailing the <form>, <label>, <input>, <select>, and <textarea> elements used for user input. It explains various input types such as text, email, number, password, and submit, along with their attributes like placeholder and name. The document concludes with a homework assignment to create a web page utilizing these elements.

Uploaded by

eman3c2022
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)
2 views14 pages

Session5 HTML Jr

This document provides an overview of HTML forms, detailing the <form>, <label>, <input>, <select>, and <textarea> elements used for user input. It explains various input types such as text, email, number, password, and submit, along with their attributes like placeholder and name. The document concludes with a homework assignment to create a web page utilizing these elements.

Uploaded by

eman3c2022
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/ 14

HTML Session 5

HTML Forms
• An HTML form is used to collect user input.

• The user input is most often sent to a server for processing.


The <form> Element

• The HTML <form> element is used


to create an HTML form for user
input.

• The <form> element is a container


for different types of input elements,
such as: text fields, checkboxes, radio
buttons, submit buttons, etc.
The <label> Element
• The <label> tag defines a label for many form elements.
The <input> Element
 Here are some examples :

• The HTML <input> element is the


most used form element.

• An <input> element can be


displayed in many ways, depending
on the type attribute.
Input Type Text
• <input type="text"> defines a single-line text input field :
The placeholder Attribute
• The input placeholder attribute specifies a short hint that
describes the expected value of an input field.

• The short hint is displayed in the input field before the user
enters a value.
Input Type email
• <input type=“email"> is used for input fields that should
contain an e-mail address.
Input Type number
• <input type=“number"> is defines a numeric input
field.
Input Type Password
• <input type=“password"> is defines a password field:

• The characters in a password field are masked


(shown as asterisks or circles).
The <select> Element
• The <select> element defines a drop-down list.

• The <option> element defines an option that can be selected.

• The name attribute specifies the name of an <input> element.


• The name attribute is used to reference elements in a JavaScript, or to
reference form data after a form is submitted.
The <textarea> Element
• The <textarea> element defines a multi-line input field (a text area):

• The rows attribute specifies the visible number of lines in a text area.
• The cols attribute specifies the visible width of a text area.
Input Type Submit
• <input type=“submit"> is defines a button for
submitting form data to a form-handler.

• It is usually displayed with submit.


• We use attribute value to display a different value instead of
submit
Home work
 Make this web page:

You might also like