diff --git a/src/jquery/jquery.js b/src/jquery/jquery.js index c309428e..81b5b64e 100644 --- a/src/jquery/jquery.js +++ b/src/jquery/jquery.js @@ -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 ); } },