<! DOCTYPE html PUBLIC "-// W3C // dtd xhtml 1.0 Transitional // EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<Html xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Title> </title>
<Style type = "text/css">
Table img
{
Width: 50px; height: 50px;
}
Table
{
Width: 600px; height: 400px;
}
Table tr td {border: solid 1px # eee ;}
</Style>
<Script src = "Jquery1.7.js" type = "text/javascript"> </script>
<Script type = "text/javascript">
$ (Function (){
$ ('# Chkall'). click (function (){
$ ('Table input [type = checkbox] '). attr ('checked', $ (this). is (': checked '));
If (this. checked ){
$ ('# Sp1'). text ('cancel all select ');
}
Else {
$ ('# Sp1'). text ('select all ');
}
})
$ ('# Chkrevert'). click (function (){
Var allcheck = $ ('table input [type = checkbox] ');
Allcheck. each (function (){
If ($ (this). is (': checked ')){
$ (This). attr ('checked', false );
}
Else {
$ (This). attr ('checked', true );
}
})
})
})
</Script>
</Head>
<Body>
<Div>
<Input id = "chkall" type = "checkbox"/> <span id = "sp1"> select all </span> <input id = "chkrevert" type = "checkbox "/> invert selection </div>
<Table>
<Tr>
<Td>
Operation
</Td>
<Td>
No.
</Td>
<Td>
Name
</Td>
<Td>
Author
</Td>
<Td>
Cover
</Td>
<Td>
Unit Price
</Td>
</Tr>
<Tr>
<Td>
<Input id = "Checkbox1" type = "checkbox"/>
</Td>
<Td>
001
</Td>
<Td>
Romance of Three Kingdoms
</Td>
<Td>
Luo Guanzhong
</Td>
<Td>
</Td>
<Td>
45
</Td>
</Tr>
<Tr>
<Td>
<Input id = "Checkbox2" type = "checkbox"/>
</Td>
<Td>
002
</Td>
<Td>
Travel to the west
</Td>
<Td>
Wu chengen
</Td>
<Td>
</Td>
<Td>
40
</Td>
</Tr>
<Tr>
<Td>
<Input id = "Checkbox3" type = "checkbox"/>
</Td>
<Td>
003
</Td>
<Td>
Water Margin
</Td>
<Td>
Shi nai
</Td>
<Td>
</Td>
<Td>
50
</Td>
</Tr>
<Tr>
<Td>
<Input id = "Checkbox4" type = "checkbox"/>
</Td>
<Td>
004
</Td>
<Td>
Dream of Red Mansions
</Td>
<Td>
Cao Xueqin
</Td>
<Td>
</Td>
<Td>
100
</Td>
</Tr>
<Tr>
<Td>
<Input id = "Checkbox5" type = "checkbox"/>
</Td>
<Td>
005
</Td>
<Td>
Home
</Td>
<Td>
Bajin
</Td>
<Td>
</Td>
<Td>
45
</Td>
</Tr>
<Tr>
<Td>
<Input id = "Checkbox6" type = "checkbox"/>
</Td>
<Td>
006
</Td>
<Td>
Teahouse
</Td>
<Td>
Lao She
</Td>
<Td>
</Td>
<Td>
35
</Td>
</Tr>
</Table>
</Body>
</Html>