files/en-us/web/api/htmlinputelement/formmethod/index.md
{{APIRef("HTML DOM")}}
The formMethod property of the {{domxref("HTMLInputElement")}} interface is the {{Glossary("HTTP")}} method used to submit the {{HtmlElement("form")}} if the {{HTMLElement("input")}} element is the control that submits the form. It reflects the value of the <input>'s formmethod attribute.
This property is valid only for submit and image <input> elements.
The value overrides the {{domxref("HTMLFormElement.method", "method")}} property of the {{domxref("HTMLFormElement")}} interface if the form is submitted via the input. This property can be retrieved or set. If set with an empty or invalid value, the invalid default value is "get". If not set at all, the value is the empty string ("").
A string; "post", "get", "dialog", or "".
inputElement.formMethod = "post";
{{Specifications}}
{{Compat}}
<input type="submit"><input type="image">