mirror of
https://github.com/jquery/jquery.git
synced 2026-04-20 03:01:22 -04:00
Filter hasClass by nodeType 1; Fixes #9630
This commit is contained in:
@@ -146,7 +146,7 @@ jQuery.fn.extend({
|
||||
hasClass: function( selector ) {
|
||||
var className = " " + selector + " ";
|
||||
for ( var i = 0, l = this.length; i < l; i++ ) {
|
||||
if ( (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
|
||||
if ( this[i].nodeType === 1 && (" " + this[i].className + " ").replace(rclass, " ").indexOf( className ) > -1 ) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user