I'm trying to create a menu where the one div gets a class if it's clicked, however I'd like to remove the class from the last link clicked on the menu.
<div id="bolinha-dentro"></div><a href="">Meu link</a>
<div id="bolinha-dentro"></div><a href="">Meu link</a>
<div id="bolinha-dentro"></div><a href="">Meu link</a>
<div id="bolinha-dentro"></div><a href="">Meu link</a>
I want the active class to be added to the link I click and if I click the next link in the menu it will remove the active class and add it to another.
$(document).ready(function() {
$('#bolinha-dentro').click(function(){
$(this).toggleClass('active');
});
})
Link to fiddle is here