title: Is a Modal Confirm Box Using JQuery Possible?
body: <p>Looked around quite a bit, and can't seem to find a JQuery solution (<em>maybe its just a limitation of JavaScript</em>) for this:</p>
  
  <pre><code>&lt;a href="somelink.php" 
     onclick="return confirm('Go to somelink.php?');"&gt;Click Here&lt;/a&gt;
  </code></pre>
  
  <p>In the above example, when a user clicks on the link, it will only go to its href if the user clicks OK in the confirm box.</p>
  
  <p>What I am trying to do is get a more modern look using a popup div. Perhaps something like this:</p>
  
  <pre><code>&lt;a href="somelink.php" 
     onclick="return jq_confirm('Go to somelink.php?');"&gt;Click Here&lt;/a&gt;
  </code></pre>
  
  <p>(Where <strong>jq_confirm</strong> is a custom JQuery confirm function that pops up a nice div with a YES/NO or OK/CANCEL button pair). </p>
  
  <p><strong>However, I cannot seem to find any such thing.</strong> </p>
  
  <p>I have looked at some JQuery widget libraries etc which offer similar functionality, but none will wait for the response from the user (<em>at least, not in the scenario described above</em>), but instead they just proceed and take the user to the link (<em>or run any JavaScript embedded in the href='' piece of the link</em>). I suspect this is because while you can attach a callback function to many of these widgets to return a true/false value, the <strong>onclick</strong> event does not wait for a response (<em>callbacks are asynchronous</em>), thereby defeating the purpose of the confirm box.</p>
  
  <p>What I need is the same kind of halt-all-javascript (modal) functionality that the default <strong>confirm()</strong> command provides. Is this possible in JQuery (<em>or even in JavaScript</em>)?</p>
  
  <p>As I am not an expert in JavaScript nor in JQuery, I defer to you gurus out there. Any JQuery (<em>or even pure JavaScript</em>) solution is welcome (<em>if possible</em>).</p>
  
  <p>Thanks -</p>