{"id":521,"date":"2022-03-13T08:40:30","date_gmt":"2022-03-13T00:40:30","guid":{"rendered":"http:\/\/blog.nonot.cn\/?p=521"},"modified":"2024-07-08T12:48:13","modified_gmt":"2024-07-08T04:48:13","slug":"jquery%e5%ae%9e%e7%8e%b0%e5%85%a8%e9%80%89%e3%80%81%e5%8f%8d%e9%80%89%e3%80%81%e8%8e%b7%e5%be%97%e6%89%80%e6%9c%89%e9%80%89%e4%b8%ad%e7%9a%84checkbox","status":"publish","type":"post","link":"https:\/\/blog.nonot.cn\/index.php\/2022\/03\/13\/jquery%e5%ae%9e%e7%8e%b0%e5%85%a8%e9%80%89%e3%80%81%e5%8f%8d%e9%80%89%e3%80%81%e8%8e%b7%e5%be%97%e6%89%80%e6%9c%89%e9%80%89%e4%b8%ad%e7%9a%84checkbox\/","title":{"rendered":"jquery\u5b9e\u73b0\u5168\u9009\u3001\u53cd\u9009\u3001\u83b7\u5f97\u6240\u6709\u9009\u4e2d\u7684checkbox"},"content":{"rendered":"<p>\u4e3e\u4e867\u4e2a\u4e0d\u540c\u7684checkbox\u72b6\u6001\uff0c\u548c\u5927\u5bb6\u4e00\u4e00\u5206\u4eab\u3002<\/p>\n<p><strong>1\u3001\u5168\u9009<\/strong><\/p>\n<div class=\"jb51code\">\n<div id=\"highlighter_695917\" class=\"syntaxhighlighter  js\">\n<div class=\"line number1 index0 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"#btn1\"<\/code><code class=\"js plain\">).click(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){ <\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"input[name='checkbox']\"<\/code><code class=\"js plain\">).attr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">,<\/code><code class=\"js string\">\"true\"<\/code><code class=\"js plain\">); <\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js plain\">})<\/code><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p><strong>2\u3001\u53d6\u6d88\u5168\u9009\uff08\u5168\u4e0d\u9009\uff09<\/strong><\/p>\n<div class=\"jb51code\">\n<div id=\"highlighter_471626\" class=\"syntaxhighlighter  js\">\n<div class=\"line number1 index0 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"#btn2\"<\/code><code class=\"js plain\">).click(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){ <\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"input[name='checkbox']\"<\/code><code class=\"js plain\">).removeAttr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">); <\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js plain\">})<\/code><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p><strong>3\u3001\u9009\u4e2d\u6240\u6709\u5947\u6570<\/strong><\/p>\n<div class=\"jb51code\">\n<div id=\"highlighter_224056\" class=\"syntaxhighlighter  js\">\n<div class=\"line number1 index0 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"#btn3\"<\/code><code class=\"js plain\">).click(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){ <\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"input[name='checkbox']:odd\"<\/code><code class=\"js plain\">).attr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">,<\/code><code class=\"js string\">\"true\"<\/code><code class=\"js plain\">); <\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js plain\">})<\/code><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p><strong>4\u3001\u9009\u4e2d\u6240\u6709\u5076\u6570<\/strong><\/p>\n<div class=\"jb51code\">\n<div id=\"highlighter_55458\" class=\"syntaxhighlighter  js\">\n<div class=\"line number1 index0 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"#btn6\"<\/code><code class=\"js plain\">).click(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){ <\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"input[name='checkbox']:even\"<\/code><code class=\"js plain\">).attr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">,<\/code><code class=\"js string\">\"true\"<\/code><code class=\"js plain\">); <\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js plain\">})<\/code><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p><strong>5\u3001\u53cd\u9009<\/strong><\/p>\n<div class=\"jb51code\">\n<div id=\"highlighter_794026\" class=\"syntaxhighlighter  js\">\n<div class=\"line number1 index0 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"#btn4\"<\/code><code class=\"js plain\">).click(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){ <\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"input[name='checkbox']\"<\/code><code class=\"js plain\">).each(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){ <\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js keyword\">if<\/code><code class=\"js plain\">($(<\/code><code class=\"js keyword\">this<\/code><code class=\"js plain\">).attr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">)) <\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"js plain\">{ <\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js keyword\">this<\/code><code class=\"js plain\">).removeAttr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">); <\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"js plain\">} <\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"js keyword\">else<\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"js plain\">{ <\/code><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js keyword\">this<\/code><code class=\"js plain\">).attr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">,<\/code><code class=\"js string\">\"true\"<\/code><code class=\"js plain\">); <\/code><\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"js plain\">} <\/code><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"js plain\">}) <\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"js plain\">})<\/code><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p>\u6216\u8005<\/p>\n<div class=\"jb51code\">\n<div id=\"highlighter_642497\" class=\"syntaxhighlighter  js\">\n<div class=\"line number1 index0 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"#invert\"<\/code><code class=\"js plain\">).click(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js spaces\">\u00a0<\/code><code class=\"js plain\">$(<\/code><code class=\"js string\">\"#ruleMessage [name='delModuleID']:checkbox\"<\/code><code class=\"js plain\">).each(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(i,o){<\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js spaces\">\u00a0\u00a0<\/code><code class=\"js plain\">$(o).attr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">,!$(o).attr(<\/code><code class=\"js string\">\"checked\"<\/code><code class=\"js plain\">));<\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"js spaces\">\u00a0<\/code><code class=\"js plain\">});<\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"js spaces\">\u00a0<\/code><code class=\"js plain\">});<\/code><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p><strong>6\u3001\u83b7\u53d6\u9009\u62e9\u9879\u7684\u503c<\/strong><\/p>\n<div class=\"jb51code\">\n<div id=\"highlighter_872117\" class=\"syntaxhighlighter  js\">\n<div class=\"line number1 index0 alt2\"><code class=\"js keyword\">var<\/code> <code class=\"js plain\">aa=<\/code><code class=\"js string\">\"\"<\/code><code class=\"js plain\">; <\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"#btn5\"<\/code><code class=\"js plain\">).click(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){ <\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"input[name='checkbox']:checkbox:checked\"<\/code><code class=\"js plain\">).each(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){ <\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"js plain\">aa+=$(<\/code><code class=\"js keyword\">this<\/code><code class=\"js plain\">).val() <\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"js plain\">}) <\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"js plain\">document.write(aa); <\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"js plain\">}) <\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"js plain\">})<\/code><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p><strong>7\u3001\u904d\u5386\u9009\u4e2d\u9879<\/strong><\/p>\n<div class=\"jb51code\">\n<div id=\"highlighter_340679\" class=\"syntaxhighlighter  js\">\n<div class=\"line number1 index0 alt2\"><code class=\"js plain\">$(<\/code><code class=\"js string\">\"input[type=checkbox][checked]\"<\/code><code class=\"js plain\">).each(<\/code><code class=\"js keyword\">function<\/code><code class=\"js plain\">(){<\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"js spaces\">\u00a0<\/code><code class=\"js comments\">\/\/\u7531\u4e8e\u590d\u9009\u6846\u4e00\u822c\u9009\u4e2d\u7684\u662f\u591a\u4e2a,\u6240\u4ee5\u53ef\u4ee5\u5faa\u73af\u8f93\u51fa <\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"js spaces\">\u00a0<\/code><code class=\"js plain\">alert($(<\/code><code class=\"js keyword\">this<\/code><code class=\"js plain\">).val()); <\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"js plain\">});<\/code><\/div>\n<div><\/div>\n<\/div>\n<\/div>\n<p>\u4e0b\u9762\u5b9e\u4f8b\u8bb2\u8ff0\u4e86jquery\u5b9e\u73b0\u5168\u9009\u3001\u53cd\u9009\u3001\u83b7\u5f97\u6240\u6709\u9009\u4e2d\u7684checkbox\u3002\u5206\u4eab\u7ed9\u5927\u5bb6\u4f9b\u5927\u5bb6\u53c2\u8003\u3002\u5177\u4f53\u5982\u4e0b\uff1a<br \/>\n\u8fd0\u884c\u6548\u679c\u622a\u56fe\u5982\u4e0b\uff1a<\/p>\n<p><img decoding=\"async\" src=\"http:\/\/blog.nonot.cn\/wp-content\/uploads\/2022\/03\/a63e5-2015121152939078.png\" alt=\"\" \/><\/p>\n<p>\u5177\u4f53\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n<div class=\"jb51code\">\n<div>\n<div id=\"highlighter_21783\" class=\"syntaxhighlighter  xhtml\">\n<div class=\"line number1 index0 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">html<\/code> <code class=\"xhtml color1\">xmlns<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"http:\/\/www.w3.org\/1999\/xhtml\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number2 index1 alt1\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">head<\/code> <code class=\"xhtml color1\">runat<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"server\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number3 index2 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">title<\/code><code class=\"xhtml plain\">&gt;\u65e0\u6807\u9898\u9875&lt;\/<\/code><code class=\"xhtml keyword\">title<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number4 index3 alt1\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">script<\/code> <code class=\"xhtml color1\">src<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"js\/jquery-1.6.min.js\"<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"text\/javascript\"<\/code><code class=\"xhtml plain\">&gt;&lt;\/<\/code><code class=\"xhtml keyword\">script<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number5 index4 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">script<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"text\/javascript\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number6 index5 alt1\"><code class=\"xhtml plain\">jQuery(function($){ <\/code><\/div>\n<div class=\"line number7 index6 alt2\"><code class=\"xhtml plain\">\/\/\u5168\u9009 <\/code><\/div>\n<div class=\"line number8 index7 alt1\"><code class=\"xhtml plain\">$(\"#btn1\").click(function(){ <\/code><\/div>\n<div class=\"line number9 index8 alt2\"><code class=\"xhtml plain\">$(\"input[name='checkbox']\").attr(\"checked\",\"true\"); <\/code><\/div>\n<div class=\"line number10 index9 alt1\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number11 index10 alt2\"><code class=\"xhtml plain\">\/\/\u53d6\u6d88\u5168\u9009 <\/code><\/div>\n<div class=\"line number12 index11 alt1\"><code class=\"xhtml plain\">$(\"#btn2\").click(function(){ <\/code><\/div>\n<div class=\"line number13 index12 alt2\"><code class=\"xhtml plain\">$(\"input[name='checkbox']\").removeAttr(\"checked\"); <\/code><\/div>\n<div class=\"line number14 index13 alt1\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number15 index14 alt2\"><code class=\"xhtml plain\">\/\/\u9009\u4e2d\u6240\u6709\u57fa\u6570 <\/code><\/div>\n<div class=\"line number16 index15 alt1\"><code class=\"xhtml plain\">$(\"#btn3\").click(function(){ <\/code><\/div>\n<div class=\"line number17 index16 alt2\"><code class=\"xhtml plain\">$(\"input[name='checkbox']:even\").attr(\"checked\",\"true\"); <\/code><\/div>\n<div class=\"line number18 index17 alt1\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number19 index18 alt2\"><code class=\"xhtml plain\">\/\/\u9009\u4e2d\u6240\u6709\u5076\u6570 <\/code><\/div>\n<div class=\"line number20 index19 alt1\"><code class=\"xhtml plain\">$(\"#btn6\").click(function(){ <\/code><\/div>\n<div class=\"line number21 index20 alt2\"><code class=\"xhtml plain\">$(\"input[name='checkbox']:odd\").attr(\"checked\",\"true\"); <\/code><\/div>\n<div class=\"line number22 index21 alt1\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number23 index22 alt2\"><code class=\"xhtml plain\">\/\/\u53cd\u9009 <\/code><\/div>\n<div class=\"line number24 index23 alt1\"><code class=\"xhtml plain\">$(\"#btn4\").click(function(){ <\/code><\/div>\n<div class=\"line number25 index24 alt2\"><code class=\"xhtml plain\">$(\"input[name='checkbox']\").each(function(){ <\/code><\/div>\n<div class=\"line number26 index25 alt1\"><code class=\"xhtml plain\">if($(this).attr(\"checked\")) <\/code><\/div>\n<div class=\"line number27 index26 alt2\"><code class=\"xhtml plain\">{ <\/code><\/div>\n<div class=\"line number28 index27 alt1\"><code class=\"xhtml plain\">$(this).removeAttr(\"checked\"); <\/code><\/div>\n<div class=\"line number29 index28 alt2\"><code class=\"xhtml plain\">} <\/code><\/div>\n<div class=\"line number30 index29 alt1\"><code class=\"xhtml plain\">else <\/code><\/div>\n<div class=\"line number31 index30 alt2\"><code class=\"xhtml plain\">{ <\/code><\/div>\n<div class=\"line number32 index31 alt1\"><code class=\"xhtml plain\">$(this).attr(\"checked\",\"true\"); <\/code><\/div>\n<div class=\"line number33 index32 alt2\"><code class=\"xhtml plain\">} <\/code><\/div>\n<div class=\"line number34 index33 alt1\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number35 index34 alt2\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number36 index35 alt1\"><code class=\"xhtml plain\">\/\/\u6216\u8bb8\u9009\u62e9\u9879\u7684\u503c <\/code><\/div>\n<div class=\"line number37 index36 alt2\"><code class=\"xhtml plain\">var aa=\"\"; <\/code><\/div>\n<div class=\"line number38 index37 alt1\"><code class=\"xhtml plain\">$(\"#btn5\").click(function(){ <\/code><\/div>\n<div class=\"line number39 index38 alt2\"><code class=\"xhtml plain\">$(\"input[name='checkbox']:checkbox:checked\").each(function(){ <\/code><\/div>\n<div class=\"line number40 index39 alt1\"><code class=\"xhtml plain\">aa+=$(this).val() <\/code><\/div>\n<div class=\"line number41 index40 alt2\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number42 index41 alt1\"><code class=\"xhtml plain\">document.write(aa); <\/code><\/div>\n<div class=\"line number43 index42 alt2\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number44 index43 alt1\"><code class=\"xhtml plain\">}) <\/code><\/div>\n<div class=\"line number45 index44 alt2\"><code class=\"xhtml plain\">&lt;\/<\/code><code class=\"xhtml keyword\">script<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number46 index45 alt1\"><code class=\"xhtml plain\">&lt;\/<\/code><code class=\"xhtml keyword\">head<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number47 index46 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">body<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number48 index47 alt1\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">form<\/code> <code class=\"xhtml color1\">id<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"form1\"<\/code> <code class=\"xhtml color1\">runat<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"server\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number49 index48 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">div<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number50 index49 alt1\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"button\"<\/code> <code class=\"xhtml color1\">id<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"btn1\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"\u5168\u9009\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number51 index50 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"button\"<\/code> <code class=\"xhtml color1\">id<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"btn2\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"\u53d6\u6d88\u5168\u9009\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number52 index51 alt1\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"button\"<\/code> <code class=\"xhtml color1\">id<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"btn3\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"\u9009\u4e2d\u6240\u6709\u5947\u6570\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number53 index52 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"button\"<\/code> <code class=\"xhtml color1\">id<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"btn6\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"\u9009\u4e2d\u6240\u6709\u5076\u6570\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number54 index53 alt1\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"button\"<\/code> <code class=\"xhtml color1\">id<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"btn4\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"\u53cd\u9009\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number55 index54 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"button\"<\/code> <code class=\"xhtml color1\">id<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"btn5\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"\u83b7\u5f97\u9009\u4e2d\u7684\u6240\u6709\u503c\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number56 index55 alt1\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">br<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number57 index56 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">name<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox1\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number58 index57 alt1\"><code class=\"xhtml plain\">checkbox1 <\/code><\/div>\n<div class=\"line number59 index58 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">name<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox2\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number60 index59 alt1\"><code class=\"xhtml plain\">checkbox2 <\/code><\/div>\n<div class=\"line number61 index60 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">name<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox3\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number62 index61 alt1\"><code class=\"xhtml plain\">checkbox3 <\/code><\/div>\n<div class=\"line number63 index62 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">name<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox4\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number64 index63 alt1\"><code class=\"xhtml plain\">checkbox4 <\/code><\/div>\n<div class=\"line number65 index64 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">name<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox5\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number66 index65 alt1\"><code class=\"xhtml plain\">checkbox5 <\/code><\/div>\n<div class=\"line number67 index66 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">name<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox6\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number68 index67 alt1\"><code class=\"xhtml plain\">checkbox6 <\/code><\/div>\n<div class=\"line number69 index68 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">name<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox7\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number70 index69 alt1\"><code class=\"xhtml plain\">checkbox7 <\/code><\/div>\n<div class=\"line number71 index70 alt2\"><code class=\"xhtml plain\">&lt;<\/code><code class=\"xhtml keyword\">input<\/code> <code class=\"xhtml color1\">type<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">name<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox\"<\/code> <code class=\"xhtml color1\">value<\/code><code class=\"xhtml plain\">=<\/code><code class=\"xhtml string\">\"checkbox8\"<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number72 index71 alt1\"><code class=\"xhtml plain\">checkbox8 <\/code><\/div>\n<div class=\"line number73 index72 alt2\"><code class=\"xhtml plain\">&lt;\/<\/code><code class=\"xhtml keyword\">div<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number74 index73 alt1\"><code class=\"xhtml plain\">&lt;\/<\/code><code class=\"xhtml keyword\">form<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number75 index74 alt2\"><code class=\"xhtml plain\">&lt;\/<\/code><code class=\"xhtml keyword\">body<\/code><code class=\"xhtml plain\">&gt; <\/code><\/div>\n<div class=\"line number76 index75 alt1\"><code class=\"xhtml plain\">&lt;\/<\/code><code class=\"xhtml keyword\">html<\/code><code class=\"xhtml plain\">&gt;<\/code><\/div>\n<\/div>\n<\/div>\n<div id=\"codetool\" class=\"codetool\">\n<div class=\"code_n\"><\/div>\n<\/div>\n<\/div>\n<p>\u4ee5\u4e0a\u5c31\u662f\u5173\u4e8ejquery\u4e2dcheckbox\u4f7f\u7528\u65b9\u6cd5\u7b80\u5355\u5b9e\u4f8b\u6f14\u793a<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u4e3e\u4e867\u4e2a\u4e0d\u540c\u7684checkbox\u72b6\u6001\uff0c\u548c\u5927\u5bb6\u4e00\u4e00\u5206\u4eab\u3002 1\u3001\u5168&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-521","post","type-post","status-publish","format-standard","hentry","category-javascript"],"_links":{"self":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/521","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/comments?post=521"}],"version-history":[{"count":1,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/521\/revisions"}],"predecessor-version":[{"id":1193,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/posts\/521\/revisions\/1193"}],"wp:attachment":[{"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/media?parent=521"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/categories?post=521"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.nonot.cn\/index.php\/wp-json\/wp\/v2\/tags?post=521"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}