I have a box without color. if the box is being click() it will addClass('.red') to make it red, and if click again the box color change to blue. they change alternatively. and I don't know how to make it.
Code
HTML
<div class='box'></div>
CSS
.box {
width: 250px;
height: 100px;
border: 1px #000 solid;
}
.red {
background: red;
}
.blue {
background: blue;
}
Javascript
$('div').click(function() {
$(this).addClass('red');
});