jQuery

  • Populate Options List
    var select = $('#some_id');
    if (select.prop) {
        var options = select.prop('options');
    } else {
        var options = select.attr('options');
    }
    $('option', select).remove();
    $.each(some_array, function (val, text) {
        options[options.length] = new Option(text, val);
    });