I am trying to apply the following jQuery click function but for some reason I can't seem to get the selector right, i.e.:
$("ul.menu li a").click(function(){
$("ul.menu li").find("a").removeAttr("id");
$(this).attr("id" , "current" );
});
This is my HTML code I am trying to apply it to, i,e,:
<div id="sidebar">
<ul class="menu noaccordion">
<li>
<a href="#" id="current" class="topm">Home</a>
</li>
<li>
<a href="#" class="topm">About Us</a>
</li>
My aim is to try and set the current menu selected using the id=current.