I chaged something, now it's working more correctly


#1

$(".box").on("click", function() {
$(this).toggleClass(colorClass);
if(colorClass == "cyan") {
$(this).removeClass("yellow");
$(this).removeClass("magenta");
} else if(colorClass == "yellow") {
$(this).removeClass("cyan");
$(this).removeClass("magenta");
} else if(colorClass == "magenta") {
$(this).removeClass("cyan");
$(this).removeClass("yellow");
}
});