EN
JavaScript - prompt function
0
points
This article will show you how to use the prompt functions in JavaScript.
The prompt()
method displays a built-in dialog box that prompts you to enter data.
Syntax
result = prompt(title, [defaultValue]);
Practical example
// ONLINE-RUNNER:browser;
const name = prompt("What's your name", 'Jacob');
console.log('Your name is ' + name);