DEV Community

Siddharth Kanojiya
Siddharth Kanojiya

Posted on

1

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)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs