hasClass error
hasClass error
What am I, a beginner in jQuery, doing wrong?
$(document).ready(function() {
$('img.pix4').each(function(index, image) {
.....
if (this.hasClass('xyz'))
{
console.log('img is in group xyz');
}
});
I get an error:
Uncaught TypeError: Object #<HTMLImageElement> has no method 'hasClass'
Using image.getClass gives the same error. All other functions such as .getAttribute() work.