add/remove class: regexp support
version 1.2.6:
// internal only, use hasClass("class")
has: function( elem, className ) {
return jQuery.inArray( className, (elem.className ||
elem).toString().split(/\s+/) ) > -1;
}
very compatible patch:
// internal only, use hasClass("class")
has: function( elem, className ) {
var classes= elem.className || elem;
if( classes instanceof RegExp ) return !
className.replace( classes, '' );
return jQuery.inArray( className,
classes.toString().split(/\s+/) ) > -1;
}
true way ;-):
// internal only, use hasClass("class")
has: function( elem, className ) {
return !className.replace( elem.className || elem, '' );
}