iterating over selection results
I want to iterate over the results of a jQuery selection, but I don't want the DOM nodes. I want each result to be a jQuery object. Is there a way to do that? For example:
$(#mySelectId > option).each(function (option) {
// option is a DOM node here, not a jQuery object.
// That means in order to call jQuery methods on it, I have to do something like this:
var jqOption = $(option); // I don't want to have to do this.
// Now I can do things like this:
jqOption.addClass('myCSSClass');
}