And use js to execute: <textarea id="runcode32729"></textarea>
[Ctrl + A select all Note: If you need to introduce external JS, You need to refresh it to execute]
-------------------------------
Method 1...
[Ctrl + A select all Note: If you need to introduce external JS, You need to refresh it to execute]
This is method 2 ....
The function to be executed is set in the value of the checkbox, and the method parameter is to pass the checkbox currently clicked as the parameter.
Here I use large jquery for operationsCopyCode The Code is as follows: $ (function (){
$ ("Ul Li a" ).css ("cursor", "Pointer ");
$ ("Ul Li a"). Click (function (){
VaR $ ck = $ (this). siblings (": checkbox ");
If ($ CK. ATTR ("name") = "Total") // select all
{
If ($ CK. ATTR ("checked") = false ){
$ CK. ATTR ("checked", "checked ");
$ ("[Name = 'ck ']: checkbox"). ATTR ("checked", "checked ");
VaR FF = $ CK. Val (); // gets the string of the function to be executed
VaR cc = $ CK. Get (0); // converts a jquery object to a DOM object.
Window [ff] (CC); // execute the string function and pass the current checkbox object as a parameter
}
Else {
$ CK. ATTR ("checked ","");
$ ("[Name = 'ck ']: checkbox"). ATTR ("checked ","");
VaR FF = $ CK. Val ();
VaR cc = $ CK. Get (0 );
Window [ff] (CC );
}
}
Else // select one
{
If ($ CK. ATTR ("checked") = false ){
$ CK. ATTR ("checked", "checked ");
VaR S = $ CK. Val ();
VaR A = $ CK. Get (0 );
Window [s] ();
}
Else {
$ CK. ATTR ("checked ","");
VaR S = $ CK. Val ();
VaR cb = $ CK. Get (0 );
Window [s] (CB );
}
}
})
})