Edit in JSFiddle

/*
this simply toggles the orange class upon clicking on the element.
if its present then it removes it, if its
not present then it adds it
*/
$('.container').click(function(){
  $(this).toggleClass('orange');
});
<div class="container"></div>
.container{
    width: 200px;
    height: 200px;
    background: green;
}

.orange{
    background: orange;    
}