관리-도구
편집 파일: example2.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() { $("#click").click(function(){ var type = $("#type").val(); swal({ title: "Title", text: "Your message", type: type }); }); }); </script> </head> <body> <table> <tr> <td>Type</td> <td><select id="type"> <option value='success' selected>success</option> <option value='warning' selected>warning</option> <option value='error' selected>error</option> <option value='info' selected>info</option> </select></td> </tr> <tr> <td> </td> <td><input type='button' value='Click me' id='click'></td> </tr> </table> </body> </html>