Get name property from an svg onClick event in React

Viewed 405

How do to get the name property from this svg onClick event in react?

I have console.logged(e.target) after the onClick event and here is what I get:

e.target: <svg class=​"MuiSvgIcon-root" focusable=​"false" viewBox=​"0 0 24 24" aria-hidden=​"true" name=​"acceptTermsOfService">​<path d=​"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z">​</path>​</svg>​

I want to get that name property but e.target.name and e.target.svg.name both return "undefined".

0 Answers
Related