Filter (Advanced Search)
Downloads
0
Views
239
Video

Video is not available... Embedded is previous playlist.

Details

The HTML <form> element can contain one or more of the following form elements:

  • <input>
  • <label>
  • <select>
  • <textarea>
  • <button>
  • <fieldset>
  • <legend>
  • <datalist>
  • <output>
  • <option>
  • <optgroup>

 

 

One of the most used form element is the <input> element.

The <input> element can be displayed in several ways, depending on the type attribute.


<!DOCTYPE html>
<html>
<body>

<h2>The input Element</h2>

<form method="get" action="/php/action_page.php">
  <label for="fname">First name:</label><br>
  <input type="text" id="fname" name="fname" value="Bintu"><br><br>
  <label for="lname">Last name:</label><br>
  <input type="text" id="lname" name="lname" value="Chaudhary"><br><br>
  <input type="submit" value="Submit">
</form> 

</body>
</html>



HTML Form Elements

Tag Description
<form> Defines an HTML form for user input
<input> Defines an input control
<textarea> Defines a multiline input control (text area)
<label> Defines a label for an <input> element
<fieldset> Groups related elements in a form
<legend> Defines a caption for a <fieldset> element
<select> Defines a drop-down list
<optgroup> Defines a group of related options in a drop-down list
<option> Defines an option in a drop-down list
<button> Defines a clickable button
<datalist> Specifies a list of pre-defined options for input controls
<output> Defines the result of a calculation
Ad