and use JS to carry out:
<script language= "JavaScript" > Function Test (str) {alert (str); } window[' Test ' (' aaaaaaaaaaaaaaaaaaaaa '); </SCRIPT>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
-------------------------------
Method one ...
<script language= "JavaScript" > Function Test (str) {alert (str); Eval (' Test (' aaaaaaaaaaaaaaaaaaa ') '); </SCRIPT>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
This is method two ....
The function to be executed by the checkbox is set in the value of the checkbox, and the method parameter passes the currently clicked CheckBox as an argument.
Here I use the big jquery to manipulate
Copy Code code 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 ()///Get a string of functions to execute
var cc = $ck. Get (0);//Convert jquery object to DOM object
WINDOW[FF] (cc); The function that executes the string and passes the current CheckBox object as an argument
}
else {
$ck. attr ("Checked", "");
$ ("[name= ' ck ']:checkbox"). attr ("Checked", "");
var ff = $ck. val ();
var cc = $ck. Get (0);
WINDOW[FF] (cc);
}
}
else//as a choice.
{
if ($ck. attr ("checked") = = False) {
$ck. attr ("Checked", "checked");
var s = $ck. Val ();
var a = $ck. Get (0);
Window[s] (a);
}
else {
$ck. attr ("Checked", "");
var s = $ck. Val ();
var cb = $ck. Get (0);
Window[s] (CB);
}
}
})
})