HTML Attributes
HTML method attribute
Sets form submission behavior. GET encodes successful controls into the URL; POST sends data in the request body; dialog closes an associated dialog. GET is the default. HTTPS is required to protect transport. 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
method="get"Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| method | enumerated: get, post, dialog | Sets form submission behavior. GET encodes successful controls into the URL; POST sends data in the request body; dialog closes an associated dialog. GET is the default. HTTPS is required to protect transport. |
Working Example
Example Snippethtml
<form action="/search" method="get"> <label> Query <input name="q"> </label> <button>Search</button></form>