My HTML code snippet looks like:
<div id="edit" ng-click="editFunction($event)">
<span id="1">
click1
</span>
<span id="2">
click2
</span>
<span id="3">
click3
</span>
<span id="4">
click4
</span>
....
</div>
In my controller.js file:
myDIV.controller('control',function($scope){
$scope.editFunction($event){
alert($event.target.id);
}
});
When a user clicks on the div tag, they should actually be clicking on one of the span tags. Although the code allows us to get the div id, I am looking to determine which specific span was clicked - whether it's id="1", 2, 3, and so on. Appreciate any insights on how to achieve this functionality. Thank you.