//unfocused
.menuItem{
background-color:red;
}
//focused
.menuItem:Focus{
background-color:blue;
}
$(document).ready(function() {
$('a[href$="' + location.pathname + '"]').addClass('active');
});
<?php
add_filter('nav_menu_css_class' , 'special_nav_class' , 10 , 2);
function special_nav_class($classes, $item){
if( in_array('current-menu-item', $classes) ){
$classes[] = 'active ';
}
return $classes;
}
// active class in menu section
// first
@php
$route = Route::current()->getName();
@endphp
// 2nd
<li class="{{ ($route == 'home') ? 'active' : '' }}"><a href="{{ route('home') }}">Home</a></li>