How can I get jQuery $('.class', context) to include context itself if it matches .class?
- by Jake
I want to be able to match against all elements in a given context including the context element itself.
Here is the code I'm using currently, but it seems inefficient. Is there a better way?
Note: I'm using jQ 1.3.2, but I'll upgrade soon so I'm interested in 1.4 solutions too.
var context = $('#id');
var filters = '.class1, .class2';
// take…