What is Indeterminate state in HTML checkbox <input>

 

Building something like this?

dropdown checkboxes

Wondering where to get this "-" state in checkbox?

 

Well, its very easy in HTML5.

You can access an property of an input field object called Indeterminate

Its a Boolean property, true will display "-" in checkbox; false, wont do anything.

Note: you cannot use it as an attribute in input field

indeterminate checkbox

Just to remember, all the input field has Indeterminate state but it only acts on checkboxes.