The experience to share is the indeterminate state of the check box, and the check boxes in HTML are:
<input id= "CB" type= "checkbox"/>
Generally encountered check box may only need to select or not select two states can be, but sometimes a third type of uncertainty is required, such as when you do a cascading menu with a check box, when multiple check boxes for a child menu are partially selected, the check boxes of the parent menu should be in an indeterminate state to reflect the partial selection of the submenu.
The method is to set the indeterminate property of the checkbox through JS, and setting this property in the label is invalid.
<script>
function init () {
Chkbox = document.getElementById ("CB");
}
function Fun1 () {
Chkbox.indeterminate = false;
Chkbox.checked = true;
}
function fun2 () {
Chkbox.indeterminate = false;
chkbox.checked = false;
}
function Fun3 () {
Chkbox.indeterminate = true;
}
</script>
<body onload= "init ()" >
<input id= "CB" type= "checkbox"/>
<button onclick= "fun1 ()" > Check </button>
<button onclick= "fun2 ()" > Not selected </button>
<button onclick= "Fun3 ()" > Part selected </button>
</Body>
In addition, the checkbox's properties are checked, as long as the checked is set in this tab, the checkbox is selected when initialized, including not limited to four types:
Checked= "true"
Checked= "false"
Checked= ""
Checked
So, if you want to initially display as unchecked, do not set the Checked property.