# Is there a way to get the ID of a SVG element onClick?

**URL:** <https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-id-of-a-svg-element-onclick/89094>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [April 19, 2024, 5:25am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-id-of-a-svg-element-onclick/89094 "2024-04-19T05:25:28Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [April 19, 2024, 6:41am UTC](https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-id-of-a-svg-element-onclick/89094/2 "2024-04-19T06:41:37Z")

</div>

Only if you inject some js, i think it only works with "name" though not with "id" (so you should do `name:"something"`

> [@New Feature: Perspective Piping](https://forum.inductiveautomation.com/t/new-feature-perspective-piping/49919/138):
>
> welp... i just had to try it out didnt it crazy_face Required version 8.1.22 Behold! JS INJECTED SVG CLICKER [jsInjectedSvgClicker.zip](https://forum.inductiveautomation.com/uploads/short-url/yDwMpbCRuyjgMnIYAO9s4YWkTIz.zip) (3.6 KB) edit: I made the value of the binding become the name it writes to in the view.custom props Be sure to set the custom prop back to null after handling your event so you can trigger the onchange events on the prop wink It should only detect things inside this view. Haven't fully tested it though.

---

_[View the full topic](https://forum.inductiveautomation.com/t/is-there-a-way-to-get-the-id-of-a-svg-element-onclick/89094)._
