HTMLFormElement: method プロパティ
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
HTMLFormElement.method プロパティは、<form> を送信するために使用される HTTP メソッドを表します。
明示的に指定されなかった場合、既定のメソッドは 'get' です。
値
文字列です。
例
js
document.forms["myform"].method = "post";
const formElement = document.createElement("form"); // フォームを生成
document.body.appendChild(formElement);
console.log(formElement.method); // 'get'
仕様書
| Specification |
|---|
| HTML> # dom-fs-method> |
ブラウザーの互換性
Loading…