1 <script type="text/javascript">
2 var b = 1;
3 function a() {
4 $("input[type=checkbox][name*=in]").each(function () { this.checked = b; });
5 //$("input[type=checkbox][name^=in]").each(function () { this.checked = b; });
6 //$("input[type=checkbox][name$=in]").each(function () { this.checked = b; });
7 b = !b;
8 }
9 </script>
10 </head>
11 <body>
12 <input type="checkbox" name="ainput11" />
13 <input type="checkbox" name="ainput12" />
14 <input type="checkbox" name="ainput13" />
15 <input type="submit" name ="button1" onclick="a();"/>
16 </body>