{"id":519,"date":"2012-02-19T13:32:48","date_gmt":"2012-02-19T13:32:48","guid":{"rendered":"http:\/\/www.sitekickr.com\/blog\/?p=519"},"modified":"2012-02-19T13:32:48","modified_gmt":"2012-02-19T13:32:48","slug":"jquery-class-selector","status":"publish","type":"post","link":"https:\/\/www.sitekickr.com\/blog\/jquery-class-selector\/","title":{"rendered":"jQuery class selector isn&#8217;t selecting my class"},"content":{"rendered":"<p>If this is true, it most likely is not an issue with jQuery, but rather your class name. Class names follow <a href=\"http:\/\/www.w3.org\/TR\/html4\/struct\/global.html#h-7.5.2\">naming conventions<\/a> used in most modern programming languages (case sensitive, no symbols, etc.).<\/p>\n<p>If your class name doesn&#39;t follow the rules, JavaScript will have a hard time finding it in the DOM.<\/p>\n<p>The root of this problem no doubt points to the all-to-forgiving web browser HTML rendering engine. Today&#39;s browsers will allow anything that somewhat resembles valid HTML to be rendered properly, without error.<\/p>\n<p>Further than that, I haven&#39;t to date found a good HTML editor which points out things like invalid class names.<\/p>\n<p>These importance of sticking to the HTML specification doesn&#39;t become apparent to most web developers until problems like these arise. I&#39;m guilty of it myself.<\/p>\n<p>The <a href=\"http:\/\/www.w3.org\/TR\/#tr_HTML\">HTML specification<\/a> is very long and certainly not a page-turner! But, it pays to learn it a little bit at a time.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>If this is true, it most likely is not an issue with jQuery, but rather your class name. Class names follow naming conventions used in&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"amp_status":""},"categories":[14,5],"tags":[157],"_links":{"self":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/519"}],"collection":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/comments?post=519"}],"version-history":[{"count":1,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/519\/revisions"}],"predecessor-version":[{"id":520,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/posts\/519\/revisions\/520"}],"wp:attachment":[{"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/media?parent=519"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/categories?post=519"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sitekickr.com\/blog\/wp-json\/wp\/v2\/tags?post=519"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}