fields
, password fields
,
checkboxes
, radio buttons
, submit button
, menus etc.
text fields
, textarea fields
, drop-down menus
,
radio buttons
, checkboxes
, etc.<form>
tag defines a form that is used to collect user input.
All the form elements should be written inside <form>
and </form>
tags.Attributes | Description |
---|---|
<form> |
It defines an HTML form to enter inputs by the used side. |
<input> |
It defines an input control. |
<select> |
It defines a multi-line input control. |
<option> |
It defines an option in a drop-down list. |
<textarea> |
It defines a drop-down list. |
<button> |
It defines a label for an input element. |
<fieldset> |
It groups the related element in a form. |
<legend> |
It defines a caption for a <fieldset> element. |
<optgroup> |
It defines a group of related options in a drop-down list. |
<label> |
It defines a label for a field. |
<input>
element.
The <input>
element can be displayed in several ways, depending on the type attribute.<select>
element defines a drop-down list. It mostly used when you have to show numbers of items. <option>
element defines different options that can be selected.<option value="abc" selected>
.
<textarea>
element defines a multi-line input field. <button>
element defines a clickable button. method
attribute specifies the HTTP method (GET or POST) to be used when submitting the form data. GET
is the default method when you submitting your form data.
Points | GET METHOD | POST METHOD |
---|---|---|
Data Pass | Limited amount of data can be sent because data is sent in header. | Large amount of data can be sent because data is sent in body. |
Security | Get request is not secured because data is data sent is part of the URL, and this data saved in browser history and server logs in plaintext. | Post request is secured because data is not exposed in URL bar and parameters are not stored in browser history or in web server logs. |
Bookmarked | Request can be bookmarked and cached. | Request can not be bookmarked and cached. |
Usability | GET method should not be suitable when you are sending sensitive data like user id or Passwords. | POST is good for when you are sending sensitive data because your data are sended in encrypted form. |
Data Length | Data length restricted, usually to 2048 characters. | No restrictions on the amount of data that can be sent. |
Hacked | Easier to hack. | More difficult to hack. |
name
attribute specifies the name of <input>
element.
It is a good practice to use this attribute, and also good for SEO purpose.<fieldset>
element is used to group related data in a form and the <legend>
element defines a caption for the <fieldset>
element.![]() |
![]() |
![]() |
![]() |
![]() |
|
---|---|---|---|---|---|
<form> |
List of color names supported by all browser »
List of character codes to display special character »
List of all language supported by all browser »
List of Country code supported by all browser »