
Swal.fire({
title: "An input!",
text: "Write something interesting:",
input: 'text',
showCancelButton: true
}).then((result) => {
if (result.value) {
alert("Result: " +result.value);
}
});
If not try this code
const {value: email} = await swal({
title: 'Input email address',
input: 'email',
inputPlaceholder: 'Enter your email address'
})
if (email) {
swal('Entered email: ' + email)
}
If you need to save this to a database then this may help
/jquery/jquery-ajax/sweet-alert-text-input-and-save-to-a-database/











