How can I dynamically add a class to an element when clicking on a specific tag inside a div? Specifically, I want to add the class "show" when clicking on an anchor tag.
This is the HTML code I am working with:
<div class="liveChatContainer online">
<div class="actions">
<span class="item title">Need help?</span>
<a href="/test"><i class="fa fa-smile-o"></i>Chat</a>
<a href="/test"><i class="fa fa-smile-o"></i>Call</a>
<a href="/test"><i class="fa fa-smile-o"></i>Email</a>
</div>
<a href="#" class="liveChatLabel">Contact</a>
</div>
To see the issue in action and explore possible solutions, check out the JSFiddle link: http://jsfiddle.net/8wLze4rf/2/