title: what is the difference between <button onclick=...> and <a href="#" onclick=.../>
body: <p>I find many times the pages use "a" tag and want to make it like a button. it's something like this:</p>
  
  <pre><code>&lt;a href="#" class="button" onclick="...." /&gt;
  </code></pre>
  
  <p>I'm confusing about why not just use "button" tag? like this:</p>
  
  <pre><code>&lt;button onclick="...."&gt;button&lt;/button&gt;
  </code></pre>
  
  <p>what is the difference between?
  I really want to learn it, thanks!</p>
  
  <p><strong>One more situation question:</strong></p>
  
  <p>Three "button-like &lt; a > tag" as below:</p>
  
  <p><img src="https://i.stack.imgur.com/oaSw9.jpg" alt="enter image description here"></p>
  
  <p>Hint:</p>
  
  <ul>
  <li>Different one call ajax then get different period record</li>
  <li>Need to use onclick="location.replace()" because back to last page smoothly.</li>
  </ul>
  
  <p>Original code:</p>
  
  <pre><code>&lt;a href="url" class="btn" &gt;Today&lt;/a&gt; 
  </code></pre>
  
  <p>I have changed to:</p>
  
  <pre><code>&lt;a href="#" onclick="location.replace(url)" class="btn" &gt;Today&lt;/a&gt; 
  </code></pre>
  
  <p>Consider about:</p>
  
  <pre><code>&lt;button onclick="location.replace(url)"&gt;Today&lt;/button&gt;
  </code></pre>
  
  <p>What will you do in this situation? Is any incorrect to use button tag ?</p>