title: location.href doesn't work with button
body: <p>I want to assign the function below with a button, but by some reason the 'location.href' part in the function doen't work. If I change from a button to a div it works, so the problem seems to be with the button.</p>
  
  <p>How come it doesn't work and is there a way of solving it (I really want to use a button)?</p>
  
  <pre><code>&lt;button id="back"&gt;Cancel&lt;/button&gt; // Doesn't work
  &lt;div id="back"&gt;Cancel&lt;/div&gt; // Works
  
      $('#back').click(function(){
          var imageId = $('#id').attr('href');
          var id = imageId.split('/');
          location.href = '/blog/' + id[3];
      });
  </code></pre>