Do you use Hyperlinks instead of JavaScript to open pages?
  v4.0 Posted at 11/09/2015 9:22 AM by William Yin
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:

  1. Copying and pasting sections of the site to an email or a document will maintain the clickable links
  2. There's an (ever-decreasing) chance a user won't have JavaScript enabled and won't be able to click the link

<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​

Related rules

    Do you feel this rule needs an update?

    If you want to be notified when this rule is updated, please enter your email address: