I have a thing in React like this
<li id="my-id" onClick={this.handleClick}>
<span>Something here</span>
<i>Some italic text here</i>
</li>
Where I need to access the id of my LI.
handleClick(ev) {
console.log(ev.target);
}
The thing is that when I click on the italic text, it console me the i element, not the li as it should.
Can someone explain me why, and how can I make onClick to return my li element?