导入SweetAlert
<script src="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.js"></script>
<link href="https://cdn.bootcss.com/sweetalert/1.1.3/sweetalert.min.css" rel="stylesheet" type="text/css" />
需要将type
指定为input
或者prompt
,
默认情况下会存在一个输入框,通过
$("fieldset").hide();隐藏
js代码
$("#register").click(function () {
swal({//sweetalert
title: "<small>请输入相关信息</small>",
text: "手机号码: <input type='text'>"
+"密码: <input type='text' >"