-
Notifications
You must be signed in to change notification settings - Fork 22.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New page for HTMLInputElement.indeterminate (#35967)
* New page for HTMLInputElement.indeterminate * Update index.md * Update index.md * Add links * Update files/en-us/web/api/htmlinputelement/indeterminate/index.md Co-authored-by: Joshua Chen <[email protected]> --------- Co-authored-by: Estelle Weyl <[email protected]>
- Loading branch information
Showing
3 changed files
with
51 additions
and
4 deletions.
There are no files selected for viewing
47 changes: 47 additions & 0 deletions
47
files/en-us/web/api/htmlinputelement/indeterminate/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
--- | ||
title: "HTMLInputElement: indeterminate property" | ||
short-title: indeterminate | ||
slug: Web/API/HTMLInputElement/indeterminate | ||
page-type: web-api-instance-property | ||
browser-compat: api.HTMLInputElement.indeterminate | ||
--- | ||
|
||
{{APIRef("HTML DOM")}} | ||
|
||
The **`indeterminate`** property of the {{domxref("HTMLInputElement")}} interface returns a boolean value that indicates whether the checkbox is in the _indeterminate_ state. For example, a "select all/deselect all" checkbox may be in the indeterminate state when some but not all of its sub-controls are checked. The `indeterminate` state can only be set via JavaScript and is only relevant to [`checkbox`](/en-US/docs/Web/HTML/Element/input/checkbox) controls. | ||
|
||
It is unrelated to the {{domxref("HTMLInputElement.checked")}} property, and an indeterminate checkbox can be either checked or unchecked. Being indeterminate only affects the checkbox's appearance (see example below), not its presence when submitted (which is controlled by the checkedness). | ||
|
||
## Value | ||
|
||
A boolean. | ||
|
||
## Examples | ||
|
||
```html | ||
<input type="checkbox" id="indeterminate-checkbox" /> | ||
<label for="indeterminate-checkbox">Indeterminate checkbox</label> | ||
``` | ||
|
||
```js | ||
const checkbox = document.getElementById("indeterminate-checkbox"); | ||
checkbox.indeterminate = true; | ||
``` | ||
|
||
{{EmbedLiveSample("examples", "", 200)}} | ||
|
||
## Specifications | ||
|
||
{{Specifications}} | ||
|
||
## Browser compatibility | ||
|
||
{{Compat}} | ||
|
||
## See also | ||
|
||
- {{domxref("HTMLInputElement")}} | ||
- {{domxref("HTMLInputElement.checked")}} | ||
- {{HTMLElement("input")}} | ||
- [Indeterminate state checkboxes](/en-US/docs/Web/HTML/Element/input/checkbox#indeterminate_state_checkboxes) | ||
- CSS {{cssxref(":indeterminate")}} property |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters