I was just wondering if it\'s possible to go through multiple select options and get their values and text(if one is selected get the value and text, if 2 is selected get both o
This function will return an array of text/value pairs for the selects matching the given class.
function getSelects(klass) {
var selected = [];
$('select.' + klass).children('option:selected').each( function() {
var $this = $(this);
selected.push( { text: $this.text(), value: $this.val() } );
});
return selected;
}