I am experiencing an issue with a script that is not performing the desired task.
I am looking for a script that can add the Class "active" to a ul element with the id "btnMob0".
Currently, my script looks like this:
<script type="text/javascript">
$(document).ready(function(){
$('btnMob').click(function(){
$('btnMob0').addClass('active');
});
})
</script>
However, this script is not working as expected and there are no debugging errors present.
CSS:
.active{
display: block !important;
}
Html:
<!-- mobile menu -->
<nav class="menuMobile">
<div class="toggle">
<i class="fas btnMob fa-align-justify"></i>
</div>
<ul id="btnMob0">
<li class=""><a href="<?php bloginfo( 'home')?>" class="nav-link">HOME</a></li>
<li class=""><a href="#" class="nav-link">ORDERS</a></li>
<li class=""><a href="#" class="nav-link">COURSES</a></li>
<li class=""><a href="#" class="nav-link">VIDEO LESSONS</a></li>
<li class=""><a href="#" class="nav-link">CAKE IN A JAR</a></li>
<li class=""><a href="#" class="nav-link">CONTACT</a></li>
</ul>
</nav>