Medium-style Confirm Dialog Box with JavaScript and CSS/CSS3

Category: Javascript , Modal & Popup | July 12, 2018
Author: brijeshb42
Views Total: 7,984 views
Official Page: Go to website
Last Update: July 12, 2018
License: MIT


Medium-style Confirm Dialog Box with JavaScript and CSS/CSS3


A tiny pure JavaScript library that creates styled confirm dialog boxes with CSS3 animations and callbacks on your web project.

Basic usage:

Add the required msc-style.css to the head section of your document.

<link rel="stylesheet" href="css/msc-style.css">

Create a basic confirm dialog box with custom alert message on your web page.


Create a confirm dialog with custom alert title/message and ok/cancel callbacks on your web page.

mscConfirm("Delete", "Are you sure?", function(){
  alert("Post deleted");
function() {

To config the confirm dialog, pass in the arguments as an options object.

  title: 'Confirm',
  subtitle: '',
  onOk: null,
  onCancel: null,
  okText: 'OK',
  cancelText: 'Cancel',
  placeholder: 'Enter value',
  dismissOverlay: false,
  closeOnEscape: true,
  defaultValue: ''



  • Add closeOnEsc option

You Might Be Interested In:

Leave a Reply