I'm trying to add the class current-menu-item
to the following div:
<div class="menu-item menu-item-type-custom menu-item-object-custom jet-custom-nav__item jet-custom-nav__item-6068">
Afterwards it should be
<div class="**current-menu-item** menu-item menu-item-type-custom menu-item-object-custom jet-custom-nav__item jet-custom-nav__item-6068">
This is how my .js looks like so far
jQuery(document).ready(function() {
if(window.location.href.match('harmonikapuls.com/konto/adressen/rechnungsadresse')){
$("menu-item.menu-item-type-custom.menu-item-object-custom.jet-custom-nav__item.jet-custom-nav__item-6068").addClass("current-menu-item");
}
});
Basically I just want not a specific URL but everything after the slug /adressen/
this was just for trying. I call my function over my function.php