Answer the question
In order to leave comments, you need to log in
How to find out which DOM element the user clicked on?
Suppose there is such a structure
<div ng-click="testClick()">
<div>
<p><span>test</span>
</p>
<ul>
<li><a>test</a>
</li>
</ul>
</div>
</div>
Answer the question
In order to leave comments, you need to log in
Как обычно - через event.target
И в обработчике используем
function testClick(e) {
console.log(e.target);
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question