gpt4 book ai didi

javascript - Sweet Alert不是占用两个输入区域吗?

转载 作者:行者123 更新时间:2023-11-27 22:37:48 28 4
gpt4 key购买 nike

swal({
title: "Log In to Continue",
html: true,
text: "Username: <input type='text'><br>Password: <input type='password'>",
type:"input"
});

enter image description here

最佳答案

 swal({
title: 'Multiple inputs',
html:
'<input id="swal-input1" class="swal2-input" autofocus>' +
'<input id="swal-input2" class="swal2-input">',
preConfirm: function() {
return new Promise(function(resolve) {
if (result) {
resolve([
$('#swal-input1').val(),
$('#swal-input2').val()
]);
}
});
}
}).then(function(result) {
swal(JSON.stringify(result));
})

关于javascript - Sweet Alert不是占用两个输入区域吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38967949/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com