Can the elements be passed as string argument to methode?

Can the elements be passed as string argument to methode?

I hope I get the terminology right ;-)

I am building a small extension and I would like the elements this extension is used on to be passed as a string. Example:

$('q, .quotes').quote();

Now, inside this function I have:

var NumberOfParents = $(this).parents().filter('q, .quotes').length;

Obviously I want to be able to replace the filter('q, .quotes') with something like filter(string). Where string equals the list of elements.

Any way to do this (apart from passing the string as an argument)?

Thnx.