Easy Tutorial
❮ Jsref Slice String Met Console Count ❯

Form method Attribute


Definition and Usage

The method attribute sets or returns the value of the form's method attribute.

The method attribute specifies how to send form data (the form-submission address is specified in the action attribute).

Syntax

The method attribute can have the following values:

Value Description
get Appends form data to the URL: URL?name=value&name=value (default)
post Submits form data using the HTTP post method

Browser Support

All major browsers support the method attribute.

Note: If the method attribute is not defined, Internet Explorer returns "get" (default), while other browsers return no value.


Example

Return the method used to send form data:

The output of the above example:

❮ Jsref Slice String Met Console Count ❯