Spread the love

This script can be use to add the “active” class to the menu item which has been clicked, also simultaneously “active” class removed from the sibling link when other menu items clicked. This feature helps you to design your active menu as per your requirement.

Below is the HTML, CSS, and JQUERY for this work.


<ul class=”navmenu”>
<li><a href=”#”>Link 1</a></li>
<li><a href=”#”>Link 2</a></li>
<li><a href=”#”>Link 3</a></li>


.navmenu {
display: flex;
justify-content: space-between;

.navmenu li{
list-style: none;
.navmenu li.active a{
color: green;


jQuery(“.navmenu ul”).on(‘click’,’li’,function(){


Check fiddle link for DEMO



Geometrical Web

× Chat Now