pickab00
1 year ago
109
6
Laravel

How to add class="active" to the current selected menu item

Posted 1 year ago by pickab00

I have a dashboard which i downloaded. But it does not add active class to the current selected menu item. How to achieve this?

Here is my html:

            <ul data-submenu-title="Main">
                <li class="active"><a href="#"><i class="sl sl-icon-settings"></i> 
Dashboard</a></li>
            </ul>

            <ul data-submenu-title="Listings">
                <li><a><i class="sl sl-icon-home"></i> My Listings</a>
                    <ul>
                        <li><a href="#">All <span class="nav-tag white"></span></a></li>
                        <li><a href="#">Pending <span class="nav-tag yellow"></span></a></li>
                    </ul>
                </li>

                <li><a><i class="sl sl-icon-layers"></i> My Rentals</a>
                    <ul>
                        <li><a href="#">All <span class="nav-tag white"></span></a></li>
                        <li><a href="#">Pending <span class="nav-tag yellow"></span></a></li>
                    </ul>
                </li>
                <li><a href="#"><i class="sl sl-icon-plus"></i> Add Listing</a></li>
                <li><a href="#"><i class="sl sl-icon-plus"></i> Add Rentals</a></li>
            </ul>

            <ul data-submenu-title="Account">
                <li><a href="#"><i class="sl sl-icon-user"></i> My Profile</a></li>
                <li><a href="#"><i class="sl sl-icon-logout"></i>Logout</a></li>
            </ul>

        </div>
    </div>

Please sign in or create an account to participate in this conversation.