I am facing an issue where I have two nested <span>
elements inside an <a>
tag. My objective is to trigger a click event on the second <span>
. I tried using the by.id
method on the custom classes I created, but it did not work. I also attempted using by.binding
, which also failed to produce the desired result. Can someone please assist me with this problem?
Here is the code snippet:
<div class="add-player">
<a href class="btn" data-ng-if="!currentUser.isAuthenticated && !vm.hasPendingInvitation">
<span>Add Player</span>
</a>
<a href class="btn" id="invite" data-ng-if="currentUser.isAuthenticated && !vm.hasPendingInvitation">
<span id="invite-player">Add Player</span>
</a>
</div>