I’m building a web chat with sockets, and I recently added href support for urls like so:
this is a test
text measage with link
when the users click this link i want to prompt: Are you sure you want to open this link
but I’m not sure how to go about it
I could do
document.querySelectAll("a").[...]
but thats highly in inefficient ’cause new messages will be added and this has to be done every time to include all the “.
How should I go about it?
Edit:
I’m specifying that:
I do not want to use the browsers default
`window.addEventListener("beforeunload"
2