title: Anchor or button
body: <p>What element should I use for JavaScript actions?</p>
  
  <p>Actions that does something like play/pause/stop/new/open/save/print/close, etc.</p>
  
  <pre><code>&lt;a id="play" href="#"&gt;Play&lt;/a&gt;
  &lt;a href="#play"&gt;Play&lt;/a&gt;
  &lt;button id="play" tabindex="0"&gt;Play&lt;/button&gt;
  &lt;div id="play" role="button" tabindex="0"&gt;Play&lt;/div&gt;
  </code></pre>
  
  <p>I see many people use anchors <code>&lt;a&gt;</code> with a <code>href="#"</code> but that doesn't feel very semantic, it feels like anchors are for hyperlinks that point to a resource, not for actions that does stuff. Then you have to hack it around with <code>event.preventDefault</code> (i.e. <code>return false</code>).</p>
  
  <p>I rarely see people use the <code>&lt;button&gt;</code> element, but isn't it what is supposed to be used?</p>