HTMLFormElement: method property - Web APIs | MDN

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

Specification
HTML
# dom-fs-method

Browser compatibility

Help improve MDN

Learn how to contribute

This page was last modified on by MDN contributors.