title: How to ask for confirmation and use e.PreventDefault on click event
body: <p>I'm trying to implement some very basic (in my opinion) functionality with jQuery. I have <code>Delete</code> link:</p>
  
  <pre><code>&lt;a href="/Delete" class="prompt-for-delete"&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p>and all I want is when the link is clicked to show some kind of confirmation window like:</p>
  
  <p><strong>Are you sure you want to delete this : Yes/No</strong></p>
  
  <p>And if <code>No</code> is clicked I want to prevent the link from executing. I use <code>jquery-1.10.2.min.js</code> and
  <code>jquery-ui-1.10.3.min.js</code> my HTML is:</p>
  
  <pre><code>&lt;div id="dialog-confirm" &gt;&lt;/div&gt;
  &lt;a href="/Delete" class="prompt-for-delete"&gt;Delete&lt;/a&gt;
  </code></pre>
  
  <p>I tried several options I found on the internet. The last one is:</p>
  
  <pre><code>$(document).ready(function () {
  
          $('.prompt-for-delete').click(function (e) {
              $("#dialog-confirm").dialog({
                  resizable: false,
                  height: 140,
                  modal: true,
                  buttons: {
                      "Delete all items": function () {
                          $(this).dialog("close");
                      },
                      Cancel: function () {
                          $(this).dialog("close");
                      }
                  }
              });
          });
  
      });
  </code></pre>
  
  <p>which is just to get something working but with this I get the dialog opened and automatically closed after a second. It seems like something very standard so could you provide an example of how to achieve this?</p>