관리-도구
편집 파일: example4.html
<!doctype html> <html> <head> <title>Create custom alert with sweetAlert jQuery plugin</title> <link href="style.css" type="text/css" rel="stylesheet"> <link href="sweetalert.css" type="text/css" rel="stylesheet"> <script src="jquery-3.4.1.min.js" type="text/javascript"></script> <script src="sweetalert.min.js" type="text/javascript"></script> <script type='text/javascript'> $( document ).ready(function() { // Prompt $("#prompt").click(function(){ swal({ title: "Add", text: "Enter your message", type: "input", showCancelButton: true, closeOnConfirm: false, inputPlaceholder: "Your message" },function(inputValue){ if (inputValue != "") { swal("Input","You have entered : " + inputValue); } }); }); // Confirm $("#confirm").click(function(){ swal({ title: "Alert", text: "Are you really want to exit", type: "warning", showCancelButton: true, confirmButtonText: 'Exit', cancelButtonText: 'Stay on the page' }); }); }); </script> </head> <body> <h2>Prompt and confirm box Demo</h2> <table> <tr> <td colspan='2'><input type='button' value='Prompt' id='prompt'> <input type='button' value='Confirm' id='confirm'> </td> </tr> <tr> <td> </td> <td></td> </tr> </table> </body> </html>