Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

javascript prompt

// window.prompt() => Prompt for user input and return the value:
const person = prompt("Please enter your name");

console.log( "Hello " + person + " !" );

// The 2nd argument (optional) holds the default value:
const color = prompt("Enter a color name", "red");
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #javascript #prompt
ADD COMMENT
Topic
Name
3+9 =