HTMLInputElement: indeterminate プロパティ
Baseline Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.
indeterminate
は HTMLInputElement
インターフェイスのプロパティで、チェックボックスが未決定状態にあるかどうかを示す論理値を返します。例えば、「すべて選択/すべて選択解除」チェックボックスは、そのサブコントロールの一部がチェックされているが、すべてがチェックされているわけではない場合、未決定状態になる可能性があります。indeterminate
状態は JavaScript 経由でのみ設定でき、 checkbox
コントロールのみに関連します。
これは、 HTMLInputElement.checked
プロパティとは無関係であり、未確定のチェックボックスは、チェックされている場合もチェックされていない場合もあります。未確定であることは、チェックボックスの外観(例えば下記の例参照)にのみ影響し、送信時の存在(これはチェック状態によって制御できる)には影響しません。
値
論理値です。
例
<input type="checkbox" id="indeterminate-checkbox" />
<label for="indeterminate-checkbox">未決定状態のチェックボックス</label>
const checkbox = document.getElementById("indeterminate-checkbox");
checkbox.indeterminate = true;
仕様書
Specification |
---|
HTML # dom-input-indeterminate |
ブラウザーの互換性
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
indeterminate |
Legend
Tip: you can click/tap on a cell for more information.
- Full support
- Full support