I'm attempting to manipulate the anchor tag with jQuery by changing its color when clicked, but I'm struggling to correctly target it.
<a v-on:click="action($event)">
<span>entry 1</span>
<span>entry 2</span>
</a>
The event.target in action always refers to either the first or second span within the anchor tag, rather than the actual anchor tag itself.
For instance:
$( $event.target ).css( "backgroundColor", "red" )
Whenever I click on the "a" tag, one of the spans will change to red instead of the "a" tag that has the v-on:click directive. Is there a way to specifically target the element with the click directive?