Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript Dumbfounded by THIS Reply To: Dumbfounded by THIS

#148957
TheDoc
Member

Here’s how I would write it out: http://jsfiddle.net/33sZG/3/

The reason why it was always returning as ‘Red’ was because you’re using the same class selector.

$('.color').hasClass('red');

That will always return true because there is a div with a class of color that also has a class of red.