How can I unset the current element from this “elems” array if it meets a certain condition?
var elems = $('input, select, textarea', this);
elems.each(function(){
if($(this).attr('name') == 'something') {
// unset `this` from elems ??
}
});
I did a console.log on it and it doesn’t appear to have keys…
You can use the
filter()function, which constructs a new jQuery object of those which returnedtruefrom the predicate function.This could of course then become;
For more info, see the
filter()docs.