$(function() {
$('#tab-1').click(function() {
var tabcontent = "<?php echo preg_replace("/\r?\n/", "\\n", addslashes($tabcontent[0]));?>";
document.getElementById('top-tabs-content').innerHTML = tabcontent;
$('.tabclass').css("background-color","#defaultcolour");
$(this).css("background-color","#F7C703");
});
});
Add a class
to the elements, then before applying the colour to clicked
element
, reset all the elements
with the default colour.