Skip to main content

html-tags.com

<form>

An interactive form that submits user input to a URL.

Baseline: Widely available · Forms

When to use it

With action and method; GET for searches and filters (shareable URLs), POST for changes.

When not to

Don't nest forms, and don't hijack submission with JS before the native behavior works.

Key attributes

action
where to submit
method
get | post | dialog
autocomplete
on/off default for the form

Example

<form action='/search' method='get'>
  <label for='q'>Search</label>
  <input type='search' id='q' name='q'>
  <button type='submit'>Go</button>
</form>
Rendered live above, source below.

Authoritative references