1
I have this following menu:
<li><a id="#nav" href="#"><i class="a glyphicon glyphicon-home">
</i><span>Inicial</span></a>
</li>
<li><a id="#nav" href="#"><i class="b glyphicon glyphicon-user">
</i>
<span>Perfil</span></a>
</li>
<li><a id="#nav" href="#"><i class="c glyphicon glyphicon-calendar">
</i>
<span>Calendário</span></a>
</li>
<li><a id="#nav" href="#"><i class="d glyphicon glyphicon-file">
</i>
<span>Material Didático</span></a>
</li>
<li><a id="#nav" href="#"><i class="e glyphicon glyphicon-stats">
</i>
<span>Frequencias</span></a>
</li>
<li><a id="#nav" href="#"><i class="f glyphicon glyphicon-list-alt">
</i>
<span>Notas</span></a>
</li>
<li><a id="#nav" href="#"><i class="g glyphicon glyphicon-usd">
</i>
<span>Financeiro</span></a>
</li>
<li><a id="#nav" href="#"><i class="h glyphicon glyphicon-book">
</i><span>Biblioteca</span></a>
</li>
<li><a id="#nav" href="#"><i class="j glyphicon glyphicon-cog">
</i>
<span>Configurações</span></a>
</li>
and I have this jQuery code:
$(document).ready(function(){
$("a#nav").click(function(){
});
});
what I need is when I click for example in the menu I get the value of class
and put into a variable, for example if I click in the first "Initial" I took the value of class
, which in this case would be the to.
It’s not good to have several
a
with the same id. Pass this Nav to a class, and search with $('a.Nav'). click– David Alves
Agree with @Davidalves
– Samuel Fontebasso