甜蜜警报html选项

编程入门 行业动态 更新时间:2024-10-23 07:26:38
本文介绍了甜蜜警报html选项的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图用html选项做一个甜蜜的警报:

swal({ title: HTML< small> Title< / small> ;!, text:A custom< span style =color:#F8BB86> html< span> message。, html: true });

但我不是那个文本放一个按钮,我试过这个:

var boton =button; swal({ title:HTML< small> Title< / small> ;!, text:< input type =+ boton +>, html:true });

但它不工作! (我想做一个类似菜单的选项(按钮))有人知道如何做这样的事情吗? 谢谢!

解决方案

可以使用按钮

像这样:

div class =snippetdata-lang =jsdata-hide =false>

var boton =button; swal({title:HTML< small> Title< / small> ;!,text:'< button type ='+ boton +'> / button>',html:true});

; link href =cdnjs.cloudflare/ajax/libs/sweetalert/1.1.3/sweetalert.min.css =stylesheet/>< script src =https:// cdnjs .cloudflare / ajax / libs / sweetalert / 1.1.3 / sweetalert.min.js>

I'm trying to make an sweet alert with the html option:

swal({ title: "HTML <small>Title</small>!", text: "A custom <span style="color:#F8BB86">html<span> message.", html: true });

But instead of that text put a button, I have tried this one:

var boton = "button"; swal({ title: "HTML <small>Title</small>!", text: "<input type=" + boton + ">", html: true });

but it doesn't work! (I want to make something like a menu with options(the buttons)) Does anybody know how to do something like 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="cdnjs.cloudflare/ajax/libs/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet" /> <script src="cdnjs.cloudflare/ajax/libs/sweetalert/1.1.3/sweetalert.min.js"></script>

更多推荐

甜蜜警报html选项

本文发布于:2023-11-27 21:11:12,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1639617.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:警报   选项   甜蜜   html

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!