Answer by Nasser Torabzade for Javascript, Jquery problems with variables

simply replace colorA with this:

var colorA = ['green', 'red'];

jQuery addClass() function accepts a class "name" not a class "selector".

Leave a Reply

Your email address will not be published. Required fields are marked *