title: Why is it bad practice to use links with the javascript: "protocol"?
body: <p>In the 1990s, there was a fashion to put Javascript code directly into <code>&lt;a&gt;</code> href attributes, like this:</p>
  
  <pre><code>&lt;a href="javascript:alert('Hello world!')"&gt;Press me!&lt;/a&gt;
  </code></pre>
  
  <p>And then suddenly I stopped to see it. They were all replaced by things like:</p>
  
  <pre><code>&lt;a href="#" onclick="alert('Hello world!')"&gt;Press me!&lt;/a&gt;
  </code></pre>
  
  <p>For a link whose sole purpose is to trigger Javascript code, and has no real <code>href</code> target, why is it encouraged to use the <code>onclick</code> property instead of the <code>href</code> property?</p>