HTML <form> Tag

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>

  • Attributes

    Attribute Value Description
    accept file_type Not supported in HTML5.
    Specifies a comma-separated list of file types  that the server accepts (that can be submitted through the file upload)
    accept-charset character_set Specifies the character encodings that are to be used for the form submission
    action URL Specifies where to send the form-data when a form is submitted
    autocomplete on
    Specifies whether a form should have autocomplete on or off
    enctype application/x-www-form-urlencoded
    Specifies how the form-data should be encoded when submitting it to the server (only for method="post")
    method get
    Specifies the HTTP method to use when sending form-data
    name text Specifies the name of a form
    novalidate novalidate Specifies that the form should not be validated when submitted
    target _blank
    Specifies where to display the response that is received after submitting the form


    <!DOCTYPE html>
    <form action="/action.jsp">
    First name: <input type="text" name="FirstName" value="hello"><br>
    Last name: <input type="text" name="LastName" value="world"><br>
    <input type="submit" value="Submit">

    © copyright 2017-2022 Completedone pvt ltd.