HTML Form Elements

In this part we gain proficiency with all HTML structure components.

The <input> Element

The most vital structure component is the <input> component.

The <input> component are extremely helpful, contingent upon the type attribute.

The <select> Element (Drop-Down List)

The <select> component characterizes a drop-down list:


<select name="color">
  <option value="Red">Red</option>
  <option value="Blue">Blue</option>
  <option value="Green">Green</option>
  <option value="Yellow">Yellow</option>
Try it Yourself »

The <option> components are utilized to choose choices .

Given show you can choose one thing

You can add a chose ascribe to express a predefined choice.


<option value="green" selected>green</option>
Try it Yourself »

The <textarea> Element

The <textarea> component is known as a multi-line input field a content area:


<textarea name="message" rows="10" cols="30">
Never be the same
Try it Yourself »

This is look in browsers:

The <button> Element

The <button> component characterizes an interactive button:


<button type="button" onclick="alert('Hello World!')">Click Here !</button>
Try it Yourself »

This is the means by which the HTML code above will be shown in a browser:

HTML5 Form Elements

HTML5 included the accompanying structure elements:

  • <datalist>
  • <keygen>
  • <output>

when you default program don't show obscure component .New component won't devastated your page.

HTML5 <datalist> Element

The <datalist> component indicates a rundown of pre-characterized alternatives for a <input> element.

Users will see a drop-down rundown of pre-characterized choices as they input data.

The list trait of the <input> component, must allude to the id trait of the <datalist> element.

OperaSafariChromeFirefoxInternet Explorer


An <input> component with pre-characterized qualities in a <datalist>:

<form action="action_page.php">
  <input list="browsers">
  <datalist id="browsers">
    <option value="Internet Explorer">
    <option value="Firefox">
    <option value="Chrome">
    <option value="Opera">
    <option value="Safari">
Try it Yourself »

HTML5 <keygen> Element

<keygen> component is to give a safe method to verify users.

The <keygen> component indicates a key-pair generator field in a form.

When the structure is submitted, two keys are produced, one private and one public.

The private key is put away locally, and the open key is sent to the server.

The open key could be utilized to produce a customer endorsement to verify the client in the future.

OperaSafariChromeFirefoxInternet Explorer


A structure with a secret key field:

<form action="action_page.php">
  Username: <input type="text" name="user">
  secret key: <password name="pass"> <input type="text">
  <input type="submit">
Try it Yourself »

HTML5 <output> Element

The <output> component speak to the outcome perform like content.

OperaSafariChromeFirefoxInternet Explorer


Perform a count and demonstrate the outcome in a <output> element:

<form action="action_page.asp"
  <input type="range"  id="a" name="a" value="50">
  100 +
  <input type="number" id="b" name="b" value="50">
  <output name="x" for="a b"></output>
  <input type="submit">
Try it Yourself »

HTML Form Elements

= new in HTML5.

Tag Description
<form> it is a HTML structure for client input
<input> it is an information control
<textarea> it is a multiline input control (content area)
<label> it is a name for a <input> element
<fieldset> it is a Groups related components in a form
<legend> it is an inscription for a <fieldset> element
<select> it is a drop-down list
<optgroup> Defines a gathering of related choices in a drop-down list
<option> it is a choice in a drop-down list
<button> it is an interactive button
<datalist> it is a rundown of pre-characterized choices for info controls
<keygen> it is a key-pair generator field (for forms)
<output> it is a the aftereffect of a calculation

Welookups is optimized for learning. © 2018 -
All Right Reserved and you agree to have read and accepted our term and condition.