Is there a method in vanilla JavaScript (not jQuery) to prevent a link from triggering an event multiple times?
I am looping through some anchor elements and adding an onclick event to each link, which displays certain content from a json file. The issue is that if the link is double-clicked or clicked repeatedly, the same content keeps getting displayed.
What would be the most effective approach to avoid this issue? Should I modify the script and convert the anchors into submit buttons to include a disabled state?