Movatterモバイル変換


[0]ホーム

URL:


  1. Web
  2. Web APIs
  3. HTMLInputElement
  4. indeterminate

HTMLInputElement: indeterminate property

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⁩.

Theindeterminate property of theHTMLInputElement interface returns a boolean value that indicates whether the checkbox is in theindeterminate state. For example, a "select all/deselect all" checkbox may be in the indeterminate state when some but not all of its sub-controls are checked. Theindeterminate state can only be set via JavaScript and is only relevant tocheckbox controls.

It is unrelated to theHTMLInputElement.checked property, and an indeterminate checkbox can be either checked or unchecked. Being indeterminate only affects the checkbox's appearance (see example below), not its presence when submitted (which is controlled by the checkedness).

Value

A boolean.

Examples

html
<input type="checkbox" /><label for="indeterminate-checkbox">Indeterminate checkbox</label>
js
const checkbox = document.getElementById("indeterminate-checkbox");checkbox.indeterminate = true;

Specifications

Specification
HTML
# dom-input-indeterminate

Browser compatibility

See also

Help improve MDN

Learn how to contribute

This page was last modified on byMDN contributors.


[8]ページ先頭

©2009-2025 Movatter.jp