HTML Attributes

HTML method attribute

Build a form with the HTML form generator

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

NameTypeDescription
methodenumerated: get, post, dialogSets 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>
HTML Reference