Email (ok)
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<link rel="stylesheet" type="text/css" href="http://localhost/library/sweetalert2/sweetalert2.min.css">
<link rel="stylesheet" type="text/css" href="http://localhost/library/fontawesome/css/all.css">
<script type="text/javascript" src="http://localhost/library/jquery/jquery.min.js"></script>
<script type="text/javascript" src="http://localhost/library/sweetalert2/sweetalert2.min.js"></script>
</head>
<body>
<button type="button" id="button">Nhấn vào đây!</button>
<script>
</script>
<script>
jQuery(document).ready(function($) {
$('#button').click(function(event) {
(async () => {
const { value: email } = await Swal.fire({
title: 'Input email address',
input: 'email',
inputPlaceholder: 'Enter your email address'
})
if (email) {
Swal.fire(`Entered email: ${email}`);
console.log(email);
}
})()
});
});
</script>
</body>
</html>
Last updated