{"id":886,"date":"2014-01-09T15:28:54","date_gmt":"2014-01-09T07:28:54","guid":{"rendered":"http:\/\/blog.amjet.biz\/IT\/?p=886"},"modified":"2014-10-23T10:09:27","modified_gmt":"2014-10-23T02:09:27","slug":"jquery-%e8%99%95%e7%90%86-radio-checkbox-%e7%9a%84-tricks","status":"publish","type":"post","link":"https:\/\/blog.amjet.biz\/IT\/?p=886","title":{"rendered":"jquery \u8655\u7406 radio, checkbox \u7684 tricks"},"content":{"rendered":"<p>\u5224\u65b7\u55ae\u4e00 checkbox \u662f\u5426\u88ab\u52fe\u9078<br \/>\n$(&#8220;#mycheckbox&#8221;).is(&#8220;:checked&#8221;)<\/p>\n<p>\u591a\u500b checkbox, \u53d6\u5f97\u5df2\u52fe\u9078\u7684 checkbox \u6578<br \/>\n$(&#8220;input[name=mycheckbox]:checked&#8221;).length<\/p>\n<p>\u52fe\u9078\u6240\u6709 checkbox<br \/>\n$(&#8220;input[name=mycheckbox]&#8221;).each(function() {<br \/>\nthis.checked=true;<br \/>\n});<\/p>\n<p>\u591a\u500b radio, \u53d6\u5f97\u5df2\u52fe\u9078\u7684 radio \u503c<br \/>\n$(&#8220;input[name=newsLang]:checked&#8221;).val()<\/p>\n<p>\u52fe\u9078\u503c\u70ba 1 \u7684 radio<br \/>\n$(&#8220;input[name=myradio]&#8221;).filter(&#8220;[value=1]&#8221;).attr(&#8216;checked&#8217;, true);<\/p>\n<p>[ratings]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5224\u65b7\u55ae\u4e00 checkbox \u662f\u5426\u88ab\u52fe\u9078 $(&#8220;#mycheckbox&#8221;).is(&#8220;:checked&#8221;) \u591a\u500b checkbox, \u53d6\u5f97\u5df2\u52fe\u9078\u7684 checkbox \u6578 $(&#8220;input[name=mycheckbox]:checked&#8221;).length \u52fe\u9078\u6240\u6709 checkbox $(&#8220;input[name=mycheckbox]&#8221;).each(function() { this.checked=true; }); \u591a\u500b radio, \u53d6\u5f97\u5df2\u52fe\u9078\u7684 radio \u503c $(&#8220;input[name=newsLang]:checked&#8221;).val() \u52fe\u9078\u503c\u70ba 1 \u7684 radio $(&#8220;input[name=myradio]&#8221;).filter(&#8220;[value=1]&#8221;).attr(&#8216;checked&#8217;, true); [ratings]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11],"tags":[118],"class_list":["post-886","post","type-post","status-publish","format-standard","hentry","category-ajax","tag-jquery"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/886","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=886"}],"version-history":[{"count":2,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions"}],"predecessor-version":[{"id":888,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=\/wp\/v2\/posts\/886\/revisions\/888"}],"wp:attachment":[{"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.amjet.biz\/IT\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}