title: HTML href=" " vs onclick="self.location.href=' ' "
body: <p>I came across this JS code:</p>
  
  <pre><code>onClick="self.location.href='http://stackoverflow.com/'"
  </code></pre>
  
  <p>I have used this in my website and it has the same function like the <code>href</code> attribute.</p>
  
  <p>I am new in JS and I do not know much about JS, but there may be a difference between the <code>onclick="self.location.href=''"</code> and <code>href=""</code> attribute.</p>
  
  <p>What is the difference?</p>
  
  <p>What are the benefits and what are the disadvantages?</p>