Say I have 3 divs each with an item class, and only one can have an active class at a time. For instance:
<div class="item active">1</div> <div class="item">2</div> <div class="item">3</div>
I have a jQuery binding code that fires a div in a click event:
$(document).ready(function () { $('.item').bind('click', function() { addClass('active');
What is the best way to do housekeeping when I remove an active class from any other div that might be active?
Thanks in advance.
source share