$('li.' + $(this).text()).toggle(true);
This code is used to take from a subnav below.
<div class="subNav">
<ul>
<li class="button">sun protective clothing</li>
</ul>
</div>
These are products that will be visible.
<div class="sun-protective-clothing"></div>
<li class="button" data-className="sun-protective-clothing">Sun Protective Clothing</li>and you could just say$('li.'+$(this).data('className')).toggle(true);You'll free up the coupling between the actual content and the class name