Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

prompt in javascript

let text = prompt("What's your name?");
if (text !== "") {
  alert(`Your name is: ${text}`);
} else {
  alert(`Name cannot be empty`)
}
Source by the-basics-of-javascript.arnavkatyal.repl.co #
 
PREVIOUS NEXT
Tagged: #prompt #javascript
ADD COMMENT
Topic
Name
4+8 =