javascript - Sweet alert html option -
i'm trying make sweet alert html option:
swal({ title: "html <small>title</small>!", text: "a custom <span style="color:#f8bb86">html<span> message.", html: true });
but instead of text put button, have tried one:
var boton = "button"; swal({ title: "html <small>title</small>!", text: "<input type=" + boton + ">", html: true });
but doesn't work! (i want make menu options(the buttons)) know how that? thanks!
you can use button
tag instead of input
.
like this:
var boton = "button"; swal({ title: "html <small>title</small>!", text: '<button type="' + boton + '">button</button>', html: true });
<link href="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet" /> <script src="https://cdnjs.cloudflare.com/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>
Comments
Post a Comment