I have set of tabs with text and icons. The active tabs have a white background with blue text and icons. The other tabs are the opposite. What I want to do is simply dynamically change the icons when they are active. The blue icon works, but doesn't change to white when not active.
Here's what I have:
if ($('#project_details').hasClass('active')) {
$('#tab1').attr('src','img/blue.png');
} else {
$('#tab1').attr('src','img/white.png');
}
HTML:
<li id="project_details" class="active">
<img src="" id="tab1">Project Details</li>