Tech notes

Daily notes about my IT activities.

2013-06-04

jquery: получить массив значений элемента "select"

by hackprime

(function (selector) {
    var opts = $(selector).find('option').toArray();
    var res = [];
    opts.forEach(function(e){
        res.push(parseInt($(e).attr('value')));
    });
    return res;
})("#SELECT_ID");