How to declare and initialize an array with key/values using JavaScript and then dynamically creating select dropdown and assigning key/values to the options using JavaScript?
@WolfShadeMar 25.2011 — #You initialize an array with var variable_name = new Array(); At this point, you can put just about anything into it and reference it by either key or index <i> </i>variable_name[0]; variable_name[1][1]; variable_name["key"]; variable_name["key"][2]; // Not quite sure about this format, but the index should work for(var i = 0; i < variable_name.length; i++) { x = variable_name[i]; alert(x[0] + " is " + x[1]); }