Input Checkbox indeterminate attribute

Definition and Usage

indeterminate Property setting or returning whether the checkbox state has changed.

The checkbox actually has three states: true, false, and indeterminate, which means the checkbox is neither 'on' nor 'off'.

The checkbox cannot be set to an indeterminate state through HTML attributes - it must be set through JavaScript.

This state can be used to force the user to select or deselect the checkbox.

Example

Set the checkbox to an indeterminate state:

document.getElementById("myCheck").indeterminate = true;

Try it yourself

Syntax

Return the indeterminate attribute:

checkboxObject.indeterminate

Set the indeterminate attribute:

checkboxObject.indeterminate = true|false

Attribute Value

Value Description
true|false

Specify the state of the checkbox.

Possible values:

  • true - The checkbox is in an indeterminate state
  • false - Default. The checkbox is not in an indeterminate state.

Technical Details

Return value: Boolean value, returned if the checkbox is in an indeterminate state true, otherwise return false.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support