HTML Attributes

HTML action attribute

Build a form with the HTML form generator

Sets the destination for form submission. Omitting it submits to the current document URL; a submit button can override it with formaction. Use HTTPS for sensitive data. Applicable elements include: <form>. Check each element’s value rules. Example uses illustrative URLs or local assets; provide the corresponding files or application endpoints when running it.

Formal Syntax & Structure

html syntaxhtml
action="/search"

Parameters & Attributes

NameTypeDescription
actionURLSets the destination for form submission. Omitting it submits to the current document URL; a submit button can override it with formaction. Use HTTPS for sensitive data.

Working Example

Example Snippethtml
<form action="/search" method="get">  <label>    Query    <input name="q">  </label>  <button>Search</button></form>

Browser Compatibility

Minimum supported versions across modern rendering engines

Blink (modern)
Chrome
1
Yes
EdgeHTML / Blink
Edge
12
Yes
Gecko
Firefox
1
Yes
WebKit
Safari
3
Yes
Basic action support on form; submission still depends on the method, target and server.
HTML Living Standard
HTML Reference