WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML
 

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:

Example

<select name="color">
  <option value="Red">Red</option>
  <option value="Blue">Blue</option>
  <option value="Green">Green</option>
  <option value="Yellow">Yellow</option>
</select>
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.

Example

<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:

Example

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

This is look in browsers:



The <button> Element

The <button> component characterizes an interactive button:

Example

<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

Example

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">
  </datalist>
</form>
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

Example

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">
</form>
Try it Yourself »

HTML5 <output> Element

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

OperaSafariChromeFirefoxInternet Explorer

Example

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

<form action="action_page.asp"
  oninput="x.value=parseInt(a.value)+parseInt(b.value)">
  0
  <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>
  <br><br>
  <input type="submit">
</form>
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.Copy right 2018 - 2019 kumar aditya singh .
All Right Reserved and you agree to have read and accepted our term and condition.
All Rights Reserved.

welookups.com