I'm making a website and I have a link that, in addition to sending a message when it's clicked, uses an anchor to put the featured section of the site.
I'm doing this as follows:
<a href="/alerta#destaque">Gerar Alerta</a>
In this way, when the user clicks on the link, an alert is generated and the page "descends" to a div with the "highlight" id that shows the contents of the generated alert.
The alert is generated from a JQuery function.
My problem is that this link works only once. The first time I click, everything happens perfectly. But if I click on the link again nothing happens.
I realized that if the anchor link is visible in the URL the link action does not work.
How could I solve this problem?