When we use the folder properties dialog box in Windows XP, we will find that the Read-only and Hidden options in the folder's Attributes category are sometimes not completely checked or unchecked, but often a state in which they are checked but the background is gray. In fact, this uncertain CheckBox state can also be expressed on the Web. In a web page, we can use <input id="chkb" type="CheckBox"> to get a CheckBox control. The most common form of this control is checked (with a checkmark) or unchecked. We can easily switch between these two states by clicking the mouse, and we can also use scripting languages to change their states, such as using JavaScript scripts: Copy code The code is as follows:chkb.checked = true; or chkb.checked = false; The following figure shows the three states that a CheckBox can display: ![]() The first and third ones are very common, and they can be set using HTML, that is, we can determine the initial state of the CheckBox through an attribute of an HTML element called checked. Although the Indeterminate state we are talking about here has been supported since IE4.0, there is no HTML element attribute to set its value, and the Indeterminate state can only be set using scripts. For example, using JavaScript scripts (indeterminate is false by default): Copy code The code is as follows:chkb.indeterminate = true; or chkb.indeterminate = false; Note : indeterminate of CheckBox is an independent property and has nothing to do with the values of checked and status of CheckBox. That is to say, it only affects the appearance of CheckBox. We can still use scripts to read the values of checked and status normally. |
<<: What kinds of MYSQL connection queries do you know?
>>: Detailed explanation of the hierarchical relationship problem caused by CSS positioning
Table of contents 1. typeof operator 2. instanceo...
Some of you may have heard that the order of trav...
When I first came into contact with docker, I was...
background First of all, I would like to state th...
It is not possible to use width and height directl...
Table of contents 1. MySQL 8.0.18 installation 2....
1. Overall steps At the beginning, we introduced ...
What is JDK? Well, if you don't know this que...
Table of contents 1. Declare a function 2. Callin...
BinLog BinLog is a binary log that records all da...
This article mainly introduces how some content i...
When a company developer executes an insert state...
Table of contents 1. Basic overview of the proces...
This article example shares the specific code of ...
template <el-table :data="dataList"&...