Nice Alert, Prompt And Confirmation Dialog Plugin - Dialog.js

File Size: 19.9 KB
Views Total: 5070
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
Nice Alert, Prompt And Confirmation Dialog Plugin - Dialog.js

Just another jQuery based native JS popup enhancement plugin that lets you create responsive, flexible alert, prompt and confirmation dialog boxes on the web application.

More features:

  • Custom action buttons.
  • Required field validation for prompt dialog box.
  • 'Fixed' or 'Absolute' position options.
  • 'Scale', 'Fade' or 'Slide' animations powered by CSS3.
  • Callback functions.


$ npm install jquery.dialog.js

How to use it:

1. Add references to jQuery library and the jQuery dialog.js plugin's files into your webpage.

<link rel="stylesheet" href="jquery.dialog.min.css">
<script src="jquery.min.js"></script>
<script src="jquery.dialog.min.js"></script>

2. Create an alert dialog using dialog.alert method:

  title: "Alert Title",
  message: "Alert Message"

3. Create a prompt dialog using dialog.prompt method:

  title: "Prompt Title",
  message: "Prompt Message",
  button: "Submit",
  required: true,
  input: {
    type: "password",
    placeholder: "This is a placeholder..."
  validate: function(value){
    if( $.trim(value) === "" ){
      return false;

4. Create a confirmation dialog using dialog.confirm method:

  title: "Confirm Title",
  message: "Confirm Message",
  cancel: "Cancel",
  button: "Accept",
  required: true,
  callback: function(value){

5. All default configuration options:


  // dialog title
  title: "",

  // dialog message
  message: "",

  // confirm button
  button: "Ok",

  // cancel button
  cancel: "Cancel",

  // is required 
  required: false,

  // or 'absolute'
  position: "fixed",

  // 'Scale', 'Fade' or 'Slide'
  animation: "scale",

  // for prompt dialog
  input: {
    type: "text"

  // validate the submitted value
  validate: function(value){},

  // executed when the user closes/submits the dialog box
  callback: function(value){} 

Change log:


  • Added html classes


  • Fixed jQuery var


  • Fixed jQuery variable


  • fixed jQuery var

This awesome jQuery plugin is developed by etienne-martin. For more Advanced Usages, please check the demo page or visit the official website.