I'm trying to create an array with selected values in Javascript without using jQuery. I've come across many solutions that involve jQuery, but they don't work with my existing code. Below is the part of my code that's causing trouble:
var c = new Array();
var cat_ = _("cat_");
for(i=0;i<cat_.options.length;i++){
c.push(cat_.options[i].value);
}
alert(c);
The above code successfully loads all options into the array, but I specifically need only the selected items. I want a solution that uses pure JavaScript, no jQuery. Any help would be greatly appreciated.