{"id":1408,"date":"2022-08-30T15:16:17","date_gmt":"2022-08-30T15:16:17","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/15\/make-tags-from-text-and-textarea-fields-content-with-javascript-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:16:17","modified_gmt":"2022-08-30T15:16:17","slug":"make-tags-from-text-and-textarea-fields-content-with-javascript-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/make-tags-from-text-and-textarea-fields-content-with-javascript-collection-of-common-programming-errors\/","title":{"rendered":"Make tags from text and textarea fields content with javascript-Collection of common programming errors"},"content":{"rendered":"<p>While you&#8217;ve already accepted an answer, I&#8217;d like to suggest this alternative:<\/p>\n<pre><code>function updateValue(els, output){\n    \/\/ creates an empty array\n    var textArray = [];\n\n    \/* iterates through the `els` array and if the value is not\n       an empty string, splits the value at the white-spaces\n       and pushes the array of values to the `textArray` *\/\n    for (var i=0,len=els.length; i<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-15 09:09:54. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>While you&#8217;ve already accepted an answer, I&#8217;d like to suggest this alternative: function updateValue(els, output){ \/\/ creates an empty array var textArray = []; \/* iterates through the `els` array and if the value is not an empty string, splits the value at the white-spaces and pushes the array of values to the `textArray` *\/ [&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-1408","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1408","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=1408"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/1408\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=1408"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=1408"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=1408"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}