Skip to content

JavaScript confirm title

  • by

This is not possible to change confirm box the title in JavaScript, from a security and anti-phishing point. The only way you could simulate it is by creating a modeless dialog window.

JavaScript confirm title

Simple example code to the default title of confirm(). There are many third-party JavaScript plugins that you could use to fake this effect so you do not have to write all that code.

<!DOCTYPE html>
  <script src=""></script>
  <link href="" rel="stylesheet" />
  <script src=""></script>

  ConfirmDialog('Are you sure');

  function ConfirmDialog(message) {
    .html('<div><h6>' + message + '?</h6></div>')
      modal: true,
      title: 'Delete message Confirm',
      zIndex: 10000,
      autoOpen: true,
      width: 'auto',
      resizable: false,
      buttons: {
        Yes: function() {
          // $(obj).removeAttr('onclick');                                
          // $(obj).parents('.Parent').remove();

          $('body').append('<h3>Confirm Dialog Result: <i>Yes</i></h3>');

        No: function() {
          $('body').append('<h3>Confirm Dialog Result: <i>No</i></h3>');

      close: function(event, ui) {



JavaScript confirm title

Do comment if you have any doubts or suggestions on this Js confirm box topic.

Note: The All JS Examples codes are tested on the Firefox browser and the Chrome browser.

OS: Windows 10

Code: HTML 5 Version

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.