I am facing a situation where I need to specifically select an element with the class .foo, but there are two anchor tags, both having the class .foo. However, I only want to select the one without the additional .bar class. How can I achieve this?
<a class="foo bar">text</a>
<a class="foo">text</a>
The current code I am using to identify the element with .foo is
$(this).parents('.post').find('.foo').text('text');