keep the current tab active on page reload <script> jQuery(window).load(function() { // this will get the full URL at the address bar var url = window.location.href; // passes on every "a" tag jQuery(".menuuuu a").each(function() { // checks if its the same on the address bar if(url == (this.href)) { jQuery(this).closest("li").addClass("active"); } }); }); </script> In html <div class="menuuuu"> <ul class="nav-list1"> <li class=""><a href="<?php echo site_url().'/dashboard/'; ?>"><i class="side-menu__icon fas fa-tachometer-alt"></i> Dashboard</a> </li> <li><a href="<?php echo site_url().'/profile/'; ?>"><i class="side-menu__icon fas fa-user"></i> My Profile</a></li>
We provide knowledgeable blogs related to php, jQuery, html, css, wordpress, woocommerce, cordova app with examples in 2021.