If possible you should always use hyperlinks to open new pages on your site instead of using JavaScript.
There are two good reasons for avoiding JavaScript-powered links:
<div onclick="window.open('mynewpage.html');">Open a new page</div>
❌ Figure: Bad Example - This link can't be clicked on if you paste it into an email or if JavaScript is off
<a href="mynewpage.html">Open a new page</a>
✅ Figure: Good Example - This link can still be clicked on when pasted and when JavaScript is turned off