alert, prompt and confirm in JavaScript

 alert("Enter the value of a");

let a = prompt("Enter value of a : ", "522");
a = Number.parseInt(a);
//document.write("The value of a is : " + a);
alert("You entered a of type " + (typeof a));
let write = confirm("Do you want to write it to the page ?");
if (write) {
    document.write("You entered : " + a);
}
else {
    document.write("Please allow me to write");
}







Comments

Popular posts from this blog

Generators tutorial in Advance JavaScript

Document Object Module DOM querySelector and querySelectorAll tutorial in JavaScript

Find Even and Odd Numbers with Loops tutorial in JavaScript