jQuery.extend(jQuery.expr[":"], { notin: function (a, b, m) { return !!!jQuery(a).parents(m[3]).length; } });