When writing in HTML, the tag is an inline element used to create both input fields and interactive controls for web-based forms. Nested within a

tag, they are useful for allowing the acceptance of user-input data of various types on a website. The following sections contain information about the tag, including an example of it in use, and related attributes and browser compatibility.

Example of code

Name:
E-mail:

Example result

Attributes

Within an HTML tag, an attribute dictates certain aspects of an HTML element. Attributes are made up of a name and value pair; all tags support standard attributes. The following table shows all the current unique HTML attributes for the tag, and a description of each.

The tag belongs to a group of tags called form elements.

  • Example of code
  • Example result
  • Attributes
  • Deprecated attributes
  • Compatibility
  • Additional form elements
  • Related information

The “script name” in the action attribute should be changed to the name and location of your script file. For example, it could be changed to an ASP, Perl, PHP, or Python script file.

The above example returns you to this page because nothing is used for the action. If you want a working example of the form tag, you can use our search engine found at the top and bottom of every page. For example, enter any computer term in the search to get an immediate definition of that term.

Deprecated attributes

A deprecated attribute is one that may function currently but is not supported in going forward. While the attribute may work with the current version of HTML, it will eventually be phased out. It is better to avoid using these attributes to help future-proof your website.

Compatibility

Additional form elements