I am working on coding a Javascript that will watch for a click event on an href that does not have an id or class. The links are generated automatically and I can’t add an ID or Class to them. I need the script to watch for the click event and use a target = “_Blank” to open a new window.
If so why not just use window.open to open the page in a new window/tab.
Also, instead of relying on event propagation you could select all anchors and attach the listener to the link itself. That would probably be better for performance in the long run.