JSFiddle - React, Tailwind, and code Playground
HTML
<svg class="foo" focusable="false" preserveAspectRatio="xMidYMid meet" xmlns="http://www.w3.org/2000/svg" fill="currentColor" width="16" height="16" viewBox="0 0 16 16" aria-hidden="true">
<path d="M8 5L13 10 12.3 10.7 8 6.4 3.7 10.7 3 10z"></path>
</svg>
JavaScript
window.onload = function() {
let foo = document.querySelector('.foo');
foo.addEventListener('click', event_Handler);
}
function event_Handler(e) {
let et = e.target;
console.log(et.nodeName);
if (et.nodeName === 'path') {
et.parentNode.click();
console.log('ok');
}
}