DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

JavaScript alert, prompt & confirm # 19

alert("Har Har Mahadev!")
let a = prompt("Enter a here", "992")
a = Number.parseInt(a)
alert("You entered a of type " + (typeof a))
let write = confirm("do you want to write it on this page")
if (write) {
document.write(a)
}
else {
document.write("Please allow me to write")
}

Top comments (0)