You are on page 1of 14

REPORT ABOUT: Html forms, Html forms

elements,html form,Attributes,html input types,


html input Attributes

Supervisor:Mr.wrya anwar
Stage 2
University Of Garmian- IT Department

1
Prepared by: Ahmad Taha

OUTLINE:
Introduction

Html forms

Html forms elements

Html form

Attributes

Html input types

Html input Attributes


2
Html Introduction

HTML is a markup language used by


the browser to manipulate text,
images, and other content, in order
to display it in the required format.
HTML was created by Tim Berners-
Lee in 1991. The first-ever version of
HTML was HTML 1.0, but the first
standard version was HTML 2.0,
published in 1995.

3
HTML Forms
<form> is a HTML element to collect input
data with containing interactive controls. It
provides facilities to input text, number,
values, email, password, and control fields
such as checkboxes, radio buttons, submit
buttons, etc., or in other words, form is a
container that contains input elements like
text, email, number, radio buttons,
checkboxes, submit buttons, etc. Forms
are generally used when you want to
collect data from the user. For example, a
user wants to buy a bag online, so he/she
has to first enter their shipping address in
the address form and then add their
payment details in the payment form to
place an order.
Forms are created by placing input fields
within paragraphs, preformatted text, lists
and tables. This gives considerable
flexibility in designing the layout of forms. 

4
<!DOCTYPE html>

<html>

<head>

  <title>Page Title</title>

</head>

<body>

  <h2>Welcome To GFG</h2>

  <form>

     

<p>

      <label>Username : <input type="text"

    </p>

5
 

     

<p>

      <label>Password : <input type="password"

    </p>

     

<p>

       <button type="submit">Submit</button>

6
    </p>

  </form>

</body>

</html>

7
Form elements

These are the following HTML <form>


elements:
 <label>: It defines label for <form>
elements.
 <input>: It is used to get input data
from the form in various types such as
text, password, email, etc by changing
its type.
 <button>: It defines a clickable button
to control other elements or execute a
functionality.
 <select>: It is used to create a drop-
down list.
 <textarea>: It is used to get input long
text content.
 <fieldset>: It is used to draw a box
around other form elements and group
the related data.
 <legend>: It defines caption for fieldset
elements.
 <datalist>: It is used to specify pre-
defined list options for input controls.
 <output>: It displays the output of
performed calculations.
 <option>: It is used to define options in
a drop-down list.

8
 <optgroup>: It is used to define group-
related options in a drop-down list.

9
HTML Attributes
In this article, we will know HTML
Attributes, their implementation through
the examples. All HTML elements have
attributes that will provide additional
information about that particular element. It
takes 2 parameters, ie, a name  &
a value which define the properties of the
element and are placed inside the element
tag.
The name parameter takes the name of
the property we would like to assign to the
element and the value  takes the properties
value or extent of the property names that
can be aligned over the element. Every
name has some value that must be written
within quotes.

10
Input Types for
HTML Forms
There are many input types available
in HTML5. You can find the list of all input
type values here. These input types are
generally used for creating HTML Forms.

We’re going to take a brief look at each of


them and explain why you should be
using them right now. Using these input
types saves time and improves user
experience. The input types to be
discussed are:

text | email | url | tel | number | range | ra
dio | color | date | month | week | time | d
atetime-local | password | submit | reset

input type="text"
HTML <input> elements with
the text type create basic, single-line
inputs. Use them when you want users to
enter a single-line value. Add

11
the required attribute to ensure that users
will fill that field.

input type="email"
The email input type is used to let the
user enter and edit an email address, or,
if the multiple attribute is defined, more
than one email addresses.

Due to the
CSS :valid and :invalid pseudo-classes,
the input value automatically shows if it is
a properly-formatted email address or not.

input type="url"
This input type is for web addresses. It is
automatically validated to ensure that it's
either empty or a properly-formatted URL
before the form can be submitted. It is
possible to use more than one URL with
the help of the multipleattribute.

12
input type="tel"
The tel input type is used to type and edit
a telephone number. This input value is
not automatically validated. It functionally
is handy with mobile browsers, because
smartphones usually recognize the input
type and change the keyboard displaying
a numeric keyboard.

input type="number"
The number input type is used to enter a
numerical value. It validates and rejects
non-numerical entries. With the help
of min, max, and step attributes you can
control the default value and set
minimum, maximum, and starting values.

13
REFERENCE:

10 Dec, 2021
HTML Attributes - GeeksforGeeks

14

You might also like