Form Tag in HTML | Important Tags in HTML

Form Tag in HTML

Form tag is a very important tag in HTML. By the form tag, we can design a form in a webpage. A form is used to pass data from a user to the server. If you want to design a form on your website or webpage then you should use form tag. A form can contain your data by text fields, check boxes, radio button, dropdown etc. A most important element in form tag is input element. Input element is the most important element in form tag.

Attributes of Form Tag:

  • Action:- This attribute is used to send form data when a form is submitted.
  • Method:- This attribute specifies that how to send form data. The form data can be sent as URL variables (with method=”get”) or as HTTP post (with method=” post”).

Some Important Elements of Form Tag:

  • <input>
  • <button>
  • <option>
  • <select>
  • <textarea>

Source Code of Form Tag is given below:

NOTE: Here some.php is a php file which will use the data which will pass through a form.




<title>table example</title>



<form action="some.php" method="post">




<td><input type=text /></td>




<td><input type=password /></td>




<td><input type=radio name=gender/>M<input type=radio name=gender/>F</td>




<td><input type=checkbox name=php/>PHP

<input type=checkbox name=java/>JAVA</td>














<td><input type=submit />

<input type=reset /></td></td>






Output of the Form Tag in HTML:

 form tag in html

Add a Comment

Your email address will not be published. Required fields are marked *