My menu structure is as follows:
<ul class="menu_bg" id="menu-main-menu">
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-653" id="menu-item-653"><a href="http://apptivowp.apptivo.com/" title="Home">Home</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-650" id="menu-item-650"><a href="http://apptivowp.apptivo.com/artists/" title="Artists">Artists</a></li>
<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-651" id="menu-item-651"><a href="http://apptivowp.apptivo.com/category/show-dates" title="Show dates">Show dates</a></li>
<li class="menu-item menu-item-type-post_type menu-item-object-page menu-item-649" id="menu-item-649"><a href="http://apptivowp.apptivo.com/gear/" title="Gear">Gear</a></li>
<li class="menu-item menu-item-type-custom menu-item-object-custom menu-item-563" id="menu-item-563"><a href="http://apptivowp.apptivo.com/category/news" title="News">News</a></li>
</ul>
I tried using the following jQuery to add a class when clicking on an li element:
<script type="text/javascript>
jQuery('ul.menu_bg li a').click(function()
{
jQuery(this)('ul.menu_bg li').addClass('mymenu');
});
</script>
However, the class 'mymenu' is not being applied when I click on the li. Can someone help me identify the issue?
Thank you, Ravi