title: Ajax/Javascript Delete Confirm Text Without Dialog
body: <p>I have searched everywhere but cannot seem to find any examples anywhere of what I am trying to achieve.</p>
  
  <p>I have a Delete button, and when you press the button I would like the text to appear on the screen without the page refreshing asking the user with Yes/No hyperlinks (not buttons) if they want to delete their message. I strictly do not want to use a modal or dialog, I just want text on screen.</p>
  
  <p>I have tried the following script on the ajax page but doesnt do exactly what I want:</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function loadDoc() {
    var xhttp;
    if (window.XMLHttpRequest) {
      // code for modern browsers
      xhttp = new XMLHttpRequest();
    } else {
      // code for IE6, IE5
      xhttp = new ActiveXObject("Microsoft.XMLHTTP");
    }
    xhttp.onreadystatechange = function() {
      if (xhttp.readyState == 4 &amp;&amp; xhttp.status == 200) {
        document.getElementById("demo").innerHTML = xhttp.responseText;
      }
    };
    xhttp.open("GET", "ajax_info.txt", true);
    xhttp.send();
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;p id="demo"&gt;Let AJAX change this text.&lt;/p&gt;
  
  &lt;button type='submit' name='btn-delete' id='btn-delete' onclick='loadDoc()'&gt;Delete&lt;/button&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>As my button is set to submit, I know its posting to the next page before asking the user for delete confirmation.</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks in advance.</p>