title: Which "href" value should I use for JavaScript links, "#" or "javascript:void(0)"?
body: <p>The following are two methods of building a link that has the sole purpose of running JavaScript code. Which is better, in terms of functionality, page load speed, validation purposes, etc.?</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myJsFunc() {
      alert("myJsFunc");
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;a href="#" onclick="myJsFunc();"&gt;Run JavaScript Code&lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>or</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="false" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function myJsFunc() {
      alert("myJsFunc");
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code> &lt;a href="javascript:void(0)" onclick="myJsFunc();"&gt;Run JavaScript Code&lt;/a&gt;</code></pre>
  </div>
  </div>
  </p>