You are here : htmlHTML 5form

<form> - HTML 5

The <form> tag is used to create an HTML form for user input.

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

  • <input>
  • <textarea>
  • <button>
  • <select>
  • <option>
  • <optgroup>
  • <fieldset>
  • <label>


Syntax

    <form     action="demo_form.asp"    method="get">     First name: <input type="text" name="fname"><br>         Last name:     <input type="text" name="lname"><br>         <input type="submit" value="Submit">    </form>


Example

    <form     action="demo_form.asp"    method="get">     First name: <input type="text" name="fname"><br>         Last name:     <input type="text" name="lname"><br>         <input type="submit" value="Submit">    </form>


Output / Return Value


Limitations


Alternatives / See Also


Reference