I'm facing an issue where a class applied only to an ID is not being found when using addClass in my JavaScript. The JS code is working and adding the class, but it seems like the CSS class is not being found. Could there be a mistake in how I am adding it since everything else is functioning correctly?
CSS
#responsive-menu-toggle {
height: 3.125em;
width: 3.125em;
border: none;
background: url("img/menu.svg") no-repeat;
-webkit-transition: all 2s ease-in-out;
-moz-transition: all 2s ease-in-out;
transition: all 2s ease-in-out;
position: absolute;
top: 1.25em;
right: 1.25em;
}
#responsive-menu-toggle .menu-toggle-active {
background: url("img/menu-close.svg") no-repeat;
}
JS
$('#responsive-menu-toggle').click(function(event) {
$('#page').toggleClass('menu-open');
$('.mobile-menu').toggleClass('mobile-menu-open');
$(this).toggleClass('menu-toggle-active');
});