.is() and complex expressions

.is() and complex expressions


Hi jQuery people,
For event delegation it would be handy if .is() (or something else)
could match against a 'complex selector'. For example:
$('body').click(function(e) {
var clicked = $(e.target);
if (clicked.is('ul.tabs-navigation a')) {
// Do X;
} else if (clicked.is('#something .foo .bar a')) {
// Do Y;
} else if (clicked.is('#sidebar h3')) {
// Do Z;
};
});
Dan Webb wrote something about Event Delegation made easy (http://
www.danwebb.net/2008/2/8/event-delegation-made-easy-in-jquery), but
this would really make it easy :)
Any idea if this is possible already and I've overlooked something, or
if this would be easy to do with a plugin? I'ved asked on IRC, but I
was forwarded here.
Thanks and regards,
Krijn