title: Javascript - confirm() inside a jquery .click() function
body: <p>I have the following</p>
  
  <pre><code>$("element").click(function() {
    var foo=bar;
    if ( foo == "bar" ) {
     confirm('Dialogue');
    }
  });
  </code></pre>
  
  <p>But I would like to bool the confirm function. I've already tried</p>
  
  <pre><code>$("element").click(function() {
    var foo=bar;
    if ( foo == "bar" ) {
      var confirm=confirm('Dialogue');
      if (confirm==true) {
        alert('true');
      } else {
        alert('false');
      }
    }
  });
  </code></pre>
  
  <p>But no confirmation box is generated. How can I accomplish this?</p>