KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am using the following jQuery to change classes on elements in an unordered list. It doesn't seem like it is the most effective way of achieving the effect. Is there a better way to write this? $(function() { $('nav li a').click( function() { $(this).parent().siblings().children().removeClass('active'); $(this).addClass('active'); }); }); Thanks S
Tags (comma-separated)
Save Edits
Cancel