AsherMaximum AsherMaximum - 2 years ago 124
Javascript Question

Partially select checkbox with javascript

Is there a way using Javascript and HTML(5) to make a checkbox be partially selected, like the checkboxes in a program installation menu when you select only some of the sub options?

Answer Source

HTML5 defines the indeterminate boolean property.

I've tested it only in the latest Safari, Chrome, and Firefox. They all support the indeterminate state.


Edit: Note that this wont work with older browsers and maybe not with current versions of IE. You'd need to rely on hacks as described in other answers here if you want to support all browsers.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download