Various Types of HTML Popup Alerts

generating preview

<!DOCTYPE html> <html lang="en"> <head> <title> Designer Desk Online </title> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css"> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script> </head> <body> <script src="https://cdn.rawgit.com/t4t5/sweetalert/v0.2.0/lib/sweet-alert.min.js"></script> <link rel="stylesheet" href="https://cdn.rawgit.com/t4t5/sweetalert/v0.2.0/lib/sweet-alert.css"> <div class="example"> <button id="b1">Basic message</button> <button id="b2">Title with a text under</button> <button id="b3">Success message!</button> <button id="b4">Warning message, with "Confirm"-button...</button> <button id="b5">you can execute something else for "Cancel".</button> <button id="b6">Message with a custom icon</button> </div> <style> .example button { float: left; background-color: #003366; color: white; border: none; box-shadow: none; font-size: 17px; font-weight: 500; font-weight: 600; border-radius: 3px; padding: 15px 35px; margin: 26px 5px 0 5px; cursor: pointer; } .example button:focus{ outline: none; } .example button:hover{ background-color: #33DE23; } .example button:active{ background-color: #003366; } </style> <script> document.getElementById('b1').onclick = function(){ swal("Here's a message!"); }; document.getElementById('b2').onclick = function(){ swal("Here's a message!", "It's pretty, isn't it?") }; document.getElementById('b3').onclick = function(){ swal("Good job!", "You clicked the button!", "success"); }; document.getElementById('b4').onclick = function(){ swal({ title: "Are you sure?", text: "You will not be able to recover this imaginary file!", type: "warning", showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: 'Yes, delete it!', closeOnConfirm: false, //closeOnCancel: false }, function(){ swal("Deleted!", "Your imaginary file has been deleted!", "success"); }); }; document.getElementById('b5').onclick = function(){ swal({ title: "Are you sure?", text: "You will not be able to recover this imaginary file!", type: "warning", showCancelButton: true, confirmButtonColor: '#DD6B55', confirmButtonText: 'Yes, delete it!', cancelButtonText: "No, cancel plx!", closeOnConfirm: false, closeOnCancel: false }, function(isConfirm){ if (isConfirm){ swal("Deleted!", "Your imaginary file has been deleted!", "success"); } else { swal("Cancelled", "Your imaginary file is safe :)", "error"); } }); }; document.getElementById('b6').onclick = function(){ swal({ title: "Sweet!", text: "Here's a custom image.", imageUrl: 'https://www.designerdeskonline.com/images/hand.jpg' }); }; </script> </body> </html>

How to Use this Elements / Source Code:

You Can Use HTML Popup Alerts, Notification, jQuery Alert Popup elements by select the above source code (CTRL + A) then copy the code (CTRL + C) and paste (CTRL + V) it in a blank html Page to initially test it. Then you can use the Above HTML Popup Alerts, Notification, jQuery Alert Popup where ever you want for your project.

Usage of HTML Popup Alerts, Notification, jQuery Alert Popup :

You Can Use this elements when you need to notify your users. All types of websites can use this types of codes. Coupon websites, after login form or Registration of a website, ecommerce website must try this easy.