If we want to inform the user about something before sending him to the url we can do it like this.
Imagine an html link
<a href="url_to_redirect" onclick='confirm("Are you sure about this?")'>Anchor text</a>
Replace the content of the onclick attribute with any JS script.