Nowy kurs! Każdy programista powinien nauczyć się Generative AI!
Wypróbuj darmową lekcję0
About popups
Hello everyone, I'm Brazilian and I'm trying to make popups exactly to the left of each 'SVG'. It's possible?? Because when I press the "information buttons", the popup appears at the very top. And when I press on others, instead of appearing near the "info buttons" appear in an unwanted place . Appreciate :) https://code.sololearn.com/W4A4j4fOVjDL/?ref=app
2 odpowiedzi
+ 1
You could use popper js, a library to place poppers. Works nicely. :-)
0
You should never have multiple elements with the same is, id's are unique, classes are for multiple elements.
You can use onclick="func(event)" to pass the event object to your function. From there you can access event.target to see what element triggered the function. also event.target.id to see the id of the triggering element.