GO-Ve01
ServicesDevelopersBooksDictionaryPapersWikidataEncyclopediaSearchBabelCareersDeck

HTMLFormElement: method property

HTML DOM

HTML DOM

The **`HTMLFormElement.method`** property represents the
HTTP method used to submit the form.

Unless explicitly specified, the default method is 'get'.

## Value

A string.

## Examples

```js
document.forms["my-form"].method = "post";

const formElement = document.createElement("form"); // Create a form
document.body.appendChild(formElement);
console.log(formElement.method); // 'get'
```

## Specifications

## Browser compatibility

source: MDN Web Docs mirror · page

Cite this

"HTMLFormElement: method property". MDN Web Docs. CC BY-SA 2.5 (MDN). https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement/method

JSON record · API collection · BibTeX · RIS · CSL-JSON · citation policy

Save to pass ·