Hello,
I want to select every textarea that does not have a DIV with class red among its parents, do something to each, and then do something else with the rest of textareas on the page. In other words, select a set of elements, work on only some of them, and then do something else with the rest.
I know I can do something like below, but is there a less clumsy way of doing it?
$('textarea').filter(function() {
return $(this).parents("div.red").length > 0;
}).css('border','1px solid red').end().filter(function() {
return $(this).parents("div.red").length == 0;
}).css('border','1px solid green');
Thanks!