I´m on 664 and there´s no problem with passing the ID to javascript. For me it looks like you didn´t assign an ID to the element… (click the rectangle and look, what the console says…)
Could it be that you have this Unique Element ID assigned in two separate Responsive Layouts? In that case a collision would be detected and a generated ID would be used.
If you could create a simplified Hype document where we can see this is in action (without any private stuff) that would be . great.
Thank you, Daniel. It was not another Layout, but the element is part of a symbol, and the symbol occurred several times in the project.
I rearranged the project, deleted everything I do not really need, and I got the symbol used exactly once - then it works without further problems.
But this kind of reduces the advantage of symbols. Is there no way I can use a symbol with the same unique IDs several times? I know that contradicts the notion of “unique ID”. But how do you do it otherwise?
Thank you for quick response. For me this case is solved, the above questions stay
Thank you, Hans-Gerd!
The solution I came up with for the problem “which element was actually clicked?” goes like this:
Give the element in the Identity section an additional HTML Attribute. Example: “name” = “2-cardcloth” (for the element representing the second card cloth.
In the JavaScript use getElementByID with the element.id and then getAttribute(“name”).
This solution works, too