This commit is contained in:
Jörn Zaefferer 2007-02-25 13:27:29 +00:00
parent 21ca78bcd0
commit eb1f881d73

View file

@ -1313,6 +1313,8 @@ jQuery.extend({
// internal only, use is(".class")
has: function( t, c ) {
t = t.className || t;
// escape regex characters
c = c.replace(/([\.\\\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:])/g, "\\$1");
return t && new RegExp("(^|\\s)" + c + "(\\s|$)").test( t );
}
},