Aggiungi un return davanti a confirm.

<a href="..." onclick="return confirm('messaggio')" ......