Javascript Replacement For Default Alert & Prompt Boxes - Bootalert

File Size: 5.72 KB
Views Total: 2374
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
Javascript Replacement For Default Alert & Prompt Boxes - Bootalert

Looking for a JavaScript alternative to default Javascript alert() and prompt() functions?

Bootalert is a tiny JavaScript (jQuery) plugin that enables you to create responsive, customizable, themeable, beautiful alert and prompt dialog boxes using the Bootstrap 4 modal component.

See Also:

How to use it:

1. Load the minified version of the Bootalert plugin after jQuery.

<link rel="stylesheet" href="/path/to/cdn/bootstrap.min.css" />
<script src="/path/to/cdn/jquery.slim.min.js"></script>
<script src="/path/to/cdn/bootstrap.min.js"></script>
<script src="/path/to/bootalert.min.js"></script>

2. Create a basic alert box.

Bootalert Basic Alert

bootalert('jQueryScript.net!')

3. Create an alert box with a custom title.

Bootalert Alert Title

bootalert('jQueryScript!','I am Bootalert')

4. Add a custom confirm button to the alert box.

Bootalert Custom Confirm Button

// 'danger' button
bootalert('jQueryScript!','I am Bootalert','danger')

// 'primary' button
bootalert('jQueryScript!','I am Bootalert','danger')

// custom button text
bootalert('jQueryScript!','I am Bootalert','danger','Ok')

5. Create a prompt dialog box.

Bootalert Prompt

bootprompt('Enter Email','primary','Get Email');

// output 
function bootrun(){
  console.log('Your Email is '+ window.bootval);
  $('.modal').modal('hide');
}

About Author:

Author: Rohit Chouhan

Website: ;https://github.com/rohit-chouhan/bootalert


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