{"id":60,"date":"2007-03-13T18:25:10","date_gmt":"2007-03-13T18:25:10","guid":{"rendered":"http:\/\/markandkelley.com\/mark\/?p=60"},"modified":"2012-01-30T02:37:08","modified_gmt":"2012-01-30T02:37:08","slug":"jquery-get-method","status":"publish","type":"post","link":"https:\/\/www.hickendesign.com\/site\/2007\/03\/jquery-get-method\/","title":{"rendered":"jquery get() method"},"content":{"rendered":"<p>Since I learned about jQuery I&#8217;ve wondered why it didn&#8217;t give you access to the original DOM elements that it selects.\u00a0 Well, it turns out that it does.\u00a0 Unfortunately I didn&#8217;t find it sooner because it doesn&#8217;t work the way you&#8217;d expect it to.\u00a0 The method is get().<\/p>\n<p>You&#8217;d expect it to work like this&#8230;<br \/>\n<code>var selectedElement = $('#divIdToSelect').get();<\/code><\/p>\n<p>Unfortunately that returns undefined.\u00a0 Instead you must pass the get method an index since the jQuery object is essentially an array.<br \/>\n<code>var selectedElement = $('#divIdToSelect').get(0);<\/code><\/p>\n<p>This second method works beautifully!\u00a0 I&#8217;ve been able to get by for the most part with out this method because jQuery is so complete but this really puts the icing on the cake that is jQuery!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Since I learned about jQuery I&#8217;ve wondered why it didn&#8217;t give you access to the original DOM elements that it selects.\u00a0 Well, it turns out that it does.\u00a0 Unfortunately I didn&#8217;t find it sooner because it doesn&#8217;t work the way you&#8217;d expect it to.\u00a0 The method is get(). You&#8217;d expect it to work like this&#8230; &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.hickendesign.com\/site\/2007\/03\/jquery-get-method\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;jquery get() method&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-general-posts"],"aioseo_notices":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/comments?post=60"}],"version-history":[{"count":1,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":915,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/posts\/60\/revisions\/915"}],"wp:attachment":[{"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/media?parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/categories?post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hickendesign.com\/site\/wp-json\/wp\/v2\/tags?post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}