title: Custom confirm dialog with JavaScript
body: <p>I would like to create a JavaScript function similar to <code>confirm()</code> that shows a dialog (a div with a question and 2 buttons) and returns <code>true</code> if the user clicks "Ok" or <code>false</code> otherwise.</p>
  
  <p>Is it possible to do that using JavaScript/jQuery but <strong>without</strong> plugins (e.g. jQuery UI or Dialog)? Because I'm trying to reduce size and round trip times...</p>
  
  <p>I tried to write this code, but I don't know how to make the function "wait" for the user click.</p>
  
  <p>I would like to use my function in this way:</p>
  
  <pre><code>answer=myConfirm("Are you sure?")
  </code></pre>
  
  <p>In this way I could use the same function in several contexts, simply changing the question passed as a parameter. This is the same behavior of <a href="http://www.pageresource.com/jscript/jconfirm.htm" rel="nofollow noreferrer">confirm()</a></p>