How to handle SVG object links?

SVG and their objects inside them can have onclick events and other events. How to catch and deal with them by a Web application?

We haven't explored this capability. Afaik, one can add JavaScript handlers in the SVG code.
https://developer.mozilla.org/en-US/docs/Web/SVG/Element/script

Do you have an SVG file with such embedded script?

No, I am trying to use a SVG image in which I need to know which area in the image is clicked by the user (like the map feature in html) and I noticed in InkScape that I can have href links in objects or groups of objects

This is the first such request we get. We will need to investigate this.

1 Like