<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
  <channel>
    <title>Snipplr</title>
    <description>Recent snippets posted on Snipplr.com</description>
    <link>https://snipplr.com/</link>
    <lastBuildDate>Tue, 09 Jun 2026 17:02:18 +0000</lastBuildDate>
    <item>
      <title>(JavaScript) Array to SELECT - nomada</title>
      <link>https://snipplr.com/view/45947/array-to-select</link>
      <description>&lt;p&gt;This function automates the creation of the &lt;OPTION&gt;s of a &lt;SELECT&gt; element. It's ideal for your AJAX apps when you create display elements using Javascript&#13;
&#13;
It accepts to different kind of arrays:&#13;
&#13;
An array of key:valuesâ€¦&#13;
&#13;
var arrDirs = {&#13;
				"a1":"Sede central",&#13;
				"a2":"EnvÃ­os",&#13;
				"a4":"FacturaciÃ³n",&#13;
				"b1":"Sucursal"&#13;
			};&#13;
&#13;
&#13;
An array of arrays, where each of the child arrays have the sintax 'ID': value, 'LABEL': textâ€¦&#13;
&#13;
var arrDirs = {&#13;
				"0":{"ID":"a1","LABEL":"Sede central"},&#13;
				"1":{"ID":"a2","LABEL":"EnvÃ­os"},&#13;
				"2":{"ID":"a4","LABEL":"FacturaciÃ³n"},&#13;
				"3":{"ID":"b1","LABEL":"Sucursal"}&#13;
			};&#13;
&#13;
Note that the ID part can be a number or an string.&lt;/p&gt;</description>
      <pubDate>Mon, 20 Dec 2010 05:39:13 UTC</pubDate>
      <guid>https://snipplr.com/view/45947/array-to-select</guid>
    </item>
  </channel>
</rss>
