How can I put an input in the alert() box?
You can use
var resp = window.prompt("Your question")
window.prompt is a blocking method (like alert). The program execution will halt until the user enters a value.
You can't put anything in an alert box. As the name indicates, it's an alert. You might be looking for a prompt which has an input text field, or confirm to get a true / false depending on user selection.
let foo = prompt('Type here');
let bar = confirm('Confirm or deny');
console.log(foo, bar);