JQuery选择器*^$

 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>

 

posted @ 2015-02-10 17:24  JJ.Net  阅读(248)  评论(0)    收藏  举报