Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML DOM Input Checkbox indeterminate Property

Improve Article
Save Article
  • Last Updated : 24 Aug, 2022
Improve Article
Save Article

The input checkbox indeterminate property in HTML DOM is used to set or return whether the state of a checkbox has been changed or not. 

Basically, the checkbox has three state –

  • true: It represent that status of checkbox is on.
  • false: It indicates that checkbox status is unchecked or off.
  • indeterminate: It represent that checkbox is neither on or not off.

Indeterminate Checkbox: Indeterminate is the third state of checkbox, it is in between checked and unchecked Indeterminate state, which can be set with the help of JavaScript. This state can be used to force the user to check or uncheck the checkbox.


It return the indeterminate property:


It set the indeterminate property:

checkboxObject.indeterminate = true|false

Return Values: It returns a Boolean that return true if the checkbox is in an indeterminate state, otherwise it returns false

Property Values: It contains a Boolean value that indicates whether the checkbox has indeterminate state or not. 

  • true: It defines that checkbox is set to indeterminate state.
  • false: It defines that the checkbox is not in indeterminate state.

Example : Below HTML code illustrates that how to return the Indeterminate Property. 


<!DOCTYPE html>
        DOM Input Checkbox indeterminate Property
<body style="text-align: center;">
    <h1 style="color:green;">
    <h2>DOM Input Checkbox indeterminate Property</h2>
        <!-- Below input elements have
             attribute checked -->
        <input type="checkbox" name="check"
            id="GFG" value="1" checked>
        Checked by default<br>
        <input type="checkbox" name="check" value="2">
        Not checked by default<br>
    </form> <br>
    <button onclick="myGeeks()">
    <p id="sudo" style="color:green;font-size:30px;"></p>
    <!-- script to return Input Checkbox
        indeterminate Property -->
        function myGeeks() {
            var g = document.getElementById("GFG").indeterminate;
            document.getElementById("sudo").innerHTML = g;


Supported Browsers: 

  • Google Chrome
  • Edge 12 and above
  • Opera
  • Apple Safari
  • Mozilla Firefox

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!