Forms in HTML


In this tutorial of 'HTML Simplified Series', we will learn What is Form in HTML? Form Tag Attributes and What a form tag container. And see how to create a form in HTML.


HTML Form

  • The form is a collection of input tags in an HTML document.

  • Forms are mainly used to take the data from the user to serve on the server.

  • Forms are created using <form> tag.


Form Tag Attributes

  • action: This attribute specifies what action will be taken after submitting the form.

  • target: This specifies on which browser tab the response will be displayed after form submission.

  • method: This attribute is used to define the HTTP method used to submit the form.


What a normal HTML Form Contains?

  • <input>

  • <label>

  • <select>

  • <option>

  • <textarea>

  • <button>

(we will learn about these in upcoming tutorials)


Simple Form Example:

<form action="/index.php" target="_blank" method="get">
    Name: <input type="text"/>
    Last Name: <input type="text">
    <button type="submit"> Submit </button>
</form>

Output:


Form Tag in HTML


Post a Comment

1 Comments
* Please Don't Spam Here. All the Comments are Reviewed by Admin.
  1. its a very nice platform and it is very helpful but i request to add more about html

    ReplyDelete

Top Post Ad

Below Post Ad