I have a div with multiple links. How can I create an event when you focus on ANY of the links in this div, and when you leave the focus in the ENTIRE div?
<a href="">LinkA</a>
<div class="links">
<a href="">Link1</a>
<a href="">Link2</a>
<a href="">Link3</a>
<a href="">Link4</a>
</div>
<a href="">LinkB</a>
Therefore, if the user uses keyboard navigation, I need one event (to call function A) when they focus on link1. I do not want any other events if they keep tabs or click links 1-3. But when they exit the div or click elsewhere on the screen, I need a second event (to call function B).
Evans source
share