1
<a onClick={handlePageClick}>
        ← <span classname{'example'}>Previous</span>
 </a>

When a user clicks , the event.target is <a>. When a user clicks on the nested <span>, "Previous", the event.target is <span>. How can I have my user click on Previous, but pass the element it is nested in (<a>)?

Dirk J. Faber
  • 4,360
  • 5
  • 20
  • 58
  • 3
    Use [`Event.currentTarget`](https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget) instead. The current target is the element that has the event handler attached to. – Ori Drori Jan 22 '20 at 20:49
  • 1
    Could not find that I was looking for exactly this, I marked it as a duplicate. – Dirk J. Faber Jan 22 '20 at 20:52

0 Answers0