I couldn’t get this work. Where do I made a mistake ? I want to add .highligh class when it clicked. And when other one is clicked, remove others’ highlight class and add highlight class to clicked one.
$("#l1").click(function(){<br>
$("#l2").removeClass("highlight");<br>
$("#l3").removeClass("highlight");<br>
$(this).addClass("highlight");<br>
});
Add a class to all of your objects for example ‘clickable’. Then using $(“.clickable”) you can access them and handle click event.
Sth like this perhaps: