So I have a list that looks like this:
<ul class="clearfix alignleft">
<li id="cat-1"><a href="#All">All</a></li>
<li id="cat-5"><a href="#Mobile">Mobile</a></li>
<li id="cat-4"><a href="#Webdesign">Webdesign</a></li>
</ul>
So when the user clicks on mobile, I take the attribute href, and slice the '#' but after that when the user clicks on webdesign let’s say I need to create a string like .Mobile,.Webdesignand so on..so I have to add to the string…. when the user clicks on an anchor I add a class of .clicked
Doesn anyone if this is possibile?
Try like below,
Markup
JS:
DEMO