I'm currently using this code to both load content from a div and change the color of the tab when a user clicks on it. However, I'm struggling to find a way to revert the background color back once the user clicks on something else. Any suggestions on how I could achieve that?
$(function() {
$('#tab-1').click(function() {
var tabcontent = "<?php echo preg_replace("/\r?\n/", "\\n", addslashes($tabcontent[0]));?>";
document.getElementById('top-tabs-content').innerHTML = tabcontent;
$(this).css("background-color","#F7C703");
});
});