/    Sign up×
Reference /Pin to ProfileBookmark

The form tag creates an HTML form for user input..


There are a number of elements that can be enclosed inside a form tag, such as <input>, <textarea>, <select>, <button>, and more.

<form action="/action-page.php" method="get">
  <label for="email">Email Address: </label>
  <input type="email" id="email" name="email">
  <input type="submit" value="Submit">


Defines the character encodings used for the form submission.

The URL to where the form-data is sent upon submission.

Designates whether a form should use autocomplete or not.

When using method="post", this attribute designates how the form-data should be encoded when it is submitted to the server.

Determines which HTTP method is used (get or post) when sending form data.

Provides the name of the form.

Designates that the form should not be validated upon submission.

Provides the relationship between the current document and the linked resource. Possible values are external, help, license, next, nofollow, noopener, noreferrer, opener, prev, and search.

Determines where the response will be displayed after the form is submitted. Possible values are _blank, _self, _parent, or _top.

Browser Compatibilty


User-submitted codepen.io examples of <form>


See the Pen on CodePen.

Want to Contribute?

Submit a codepen.io link that demonstrates <form>:

to submit a demo.


Help @reference spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ

legal: ({
terms: of use,
privacy: policy
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,