title: Javascript & Django - Confirm() cancel should not follow href
body: <p>I'm using Django in my project and I'm getting some problems with the <code>confirm</code> function in order to prevent item deletion from datatable option.</p>
  
  <p>Despite cancelling in the confirm pop-up, the link still sends me to the default link href and the object is deleted.</p>
  
  <p>This is my HTML:</p>
  
  <pre><code>&lt;a class='btn btn-danger btn-xs' id="elimina-objeto" onclick="confirmaEliminacion()" href="{% url 'eliminarQueja' queja.id %}"&gt;Eliminar&lt;/a&gt;
  </code></pre>
  
  <p>And my JS:</p>
  
  <pre><code>function confirmaEliminacion() {
    var res = confirm("Va a eliminar el objeto seleccionado. Si desea continuar, pulse aceptar.");
  
    if (res) {
      return false;
    } else {
      document.getElementById("elimina-objeto").href = "#";
    }
  }
  </code></pre>