{"id":1358,"date":"2022-08-30T15:15:52","date_gmt":"2022-08-30T15:15:52","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/13\/use-jquery-selector-as-method-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:15:52","modified_gmt":"2022-08-30T15:15:52","slug":"use-jquery-selector-as-method-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/use-jquery-selector-as-method-collection-of-common-programming-errors\/","title":{"rendered":"Use jQuery selector as method-Collection of common programming errors"},"content":{"rendered":"<p>I have page with many inputs inside a set of different divs.<\/p>\n<p>A <strong>subset<\/strong> of those inputs are created dinamically and they can be also deleted.<\/p>\n<p>By <strong>creating<\/strong> and <strong>deleting<\/strong> elements i could have a list of inputs named as shown:<\/p>\n<pre><code>\n    \n     \n     \n    \n\n    \n     \n     \n     \n\n\n    \n     \n     \n    \n\n    \n     \n     \n     \n\n    ....\n<\/code><\/pre>\n<p>I need to select all elements with a name that ends with [price] and save in a different variable of each div.<\/p>\n<p>I tried a jQuery selector used as method of getelementbyid:<\/p>\n<pre><code>first_price_inputs = document.getElementById('first').jQuery('input[name$=\"[price]\"]')\nsecond_price_inputs = document.getElementById('second').jQuery('input[name$=\"[price]\"]')\n<\/code><\/pre>\n<p>But i get this error:<\/p>\n<pre><code>Uncaught TypeError: Object # has no method 'jQuery'\n<\/code><\/pre>\n<p>please help!<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-13 09:49:32. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I have page with many inputs inside a set of different divs. A subset of those inputs are created dinamically and they can be also deleted. By creating and deleting elements i could have a list of inputs named as shown: &#8230;. I need to select all elements with a name that ends with [price] [&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-1358","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1358","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=1358"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1358\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1358"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1358"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1358"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}