So try the following: -
JSFiddle- http://jsfiddle.net/dtzjN/198/
All you have to do is have a common class in all divs, click, remove the color class from each other div and add the color class to the clicked div.
<div class="divs"> Thumb1 </div> <div class="divs"> Thumb1 </div> <div class="divs"> Thumb1 </div> <div class="divs"> Thumb1 </div>
Js
var addclass = 'color'; var $cols = $('.divs').click(function(e) { $cols.removeClass(addclass); $(this).addClass(addclass); });
CSS
.color { background-color: yellow; }
source: - How to highlight a selected list item using jquery?
Modified on request.
source share