So, I am using this function below to change the background of one element at a time. I have it working great, considering I got it from here anyway, but what I would like is that when you click on the second or third child after the class has been added, it will remove the class and add the active class back to the first child.
$(window).load(function(){
$('.innernav li:first-child a').addClass('back');
});
$("a").click(function () {
$('a').removeClass('back');
$(this).addClass('back');
});
Quite simply, I would like it to revert to the first-child rule when an element has been clicked for a second time. The reason it is like this is because, on my site, when you click one, it will display content below it. When a different element is clicked, it will display new content and hide the previous, but when clicked again, it'll return the content back to the original content that displays when the page initially loads. I will include that function in a jsFiddle for you guys to have a better understanding of what is actually going on. I haven't been able to get the toggleDisplay to work in jsFiddle, but it does work fine normally.