I currently have a parent container with a child object tag that houses my svg.
I've been attempting to detect clicks on my image, but unfortunately, it's not functioning as expected.
In the provided code snippet, the alert message only appears when clicking outside the displayed svg.
HTML:
<div class="calendarWidget" onclick="alert('test');">
<span>
<object onclick="alert('test1');" data="https://www.multiservicetolls.com/wp-content/uploads/revslider/assets/svg/busy-icons-svg/folder-private.svg" type="image/svg+xml"></object>
</span>
</div>
CSS:
.calendarWidget {
position: fixed;
max-width: 200px;
width: 200px;
right: 20px;
bottom: 20px;
background-color:green;
z-index: 1;
}
Due to my specific requirements, I'm unable to embed script code directly within the svg file.