You are here: Reference > JavaScript > client-side > HTML DOM > properties > indeterminate (input:checkbox)

indeterminate property (input:checkbox)

Browser support:
Specifies or returns a Boolean value that indicates whether the state of a checkbox has changed.
Note: The indeterminate property is supported in Firefox from version 3.6.
When the indeterminate state is used for a checkbox, it behaves as a three-state control. A checkbox cannot be changed to indeterminate state through the user interface, this state can only be set from scripts. This state can be used to force the user to check or uncheck a checkbox. See the example below for details.
Note that modifying the value of the indeterminate property has no effect on the value of the checked and status properties.


You can find the related objects in the Supported by objects section below.
This property is read/write.

Possible values:

Boolean that indicates the checkbox state.
One of the following values:
The checked and status properties can be used to get the current state of the checkbox.
The checkBox is in indeterminate state.
Default: false.

Example HTML code 1:

This example illustrates the use of the indeterminate property:
    <script type="text/javascript">
        function Init () {
            var acceptAgreement = document.getElementById ("acceptAgreement");
            if ('indeterminate' in acceptAgreement) {
                acceptAgreement.indeterminate = true;

        function SubmitForm () {
            var acceptAgreement = document.getElementById ("acceptAgreement");

            if ('indeterminate' in acceptAgreement) {
                if (acceptAgreement.indeterminate) {
                    alert ("You must accept or decline the agreement!");

            if (acceptAgreement.checked) {
                alert ("You accepted the agreement.");
            else {
                alert ("You declined the agreement.");
<body onload="Init ()">
    Try to register first!
        <input type="checkbox" id="acceptAgreement" /> 
        <label for="acceptAgreement">I accept the User Agreement and Privacy Policy</label>
        <br /><br />
        <button onclick="SubmitForm ()">Register</button>
Did you find this example helpful? yes no

Supported by objects:

Related pages:

External links:

User Contributed Comments

Post Content

Post Content