{"id":414,"date":"2022-08-30T15:00:57","date_gmt":"2022-08-30T15:00:57","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/jquery-disable-element-on-checkbox-change-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:00:57","modified_gmt":"2022-08-30T15:00:57","slug":"jquery-disable-element-on-checkbox-change-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/jquery-disable-element-on-checkbox-change-collection-of-common-programming-errors\/","title":{"rendered":"Jquery disable element on checkbox change-Collection of common programming errors"},"content":{"rendered":"<p><strong>Working demo<\/strong> http:\/\/jsfiddle.net\/2gbHQ\/5\/<\/p>\n<p><strong>Good Read<\/strong> http:\/\/api.jquery.com\/prop\/<\/p>\n<blockquote>\n<p>The .prop() method gets the property value for only the first element in the matched set. It returns undefined for the value of a property that has not been set, or if the matched set has no elements. To get the value for each element individually, use a looping construct such as jQuery&#8217;s .each() or .map() method.<\/p>\n<\/blockquote>\n<p><strong>Jquery code<\/strong><\/p>\n<pre><code>$('#dw').change(function() {\n    if ($(this).is(':checked')) {\n        $('#oo').prop('disabled', false);\n    } else {\n        $('#oo').prop('disabled', true);\n    }\n});\u200b\n<\/code><\/pre>\n<p><strong>HTML<\/strong><\/p>\n<pre><code>\n\n\n    a\n    b\n    c\n\n\u200b\n<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 19:09:41. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>Working demo http:\/\/jsfiddle.net\/2gbHQ\/5\/ Good Read http:\/\/api.jquery.com\/prop\/ The .prop() method gets the property value for only the first element in the matched set. It returns undefined for the value of a property that has not been set, or if the matched set has no elements. To get the value for each element individually, use a looping [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-414","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/414","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=414"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/414\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=414"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=414"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=414"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}