+ 5

Please how do one get input from the user using Pure JS. No HTML.

21st Mar 2019, 12:57 PM
Ugoh Ifeanyi
Ugoh Ifeanyi - avatar
5 Respuestas
+ 2
Use the prompt build in function but note out of the is prompt is a string and if you need to get you will have to use the number build in function prompt() toNumber()
23rd Mar 2019, 5:32 AM
George S Mulbah II
George S Mulbah II - avatar
+ 15
Use prompt() to get user input: var input = prompt();
21st Mar 2019, 1:02 PM
VEDANG
VEDANG - avatar
+ 4
For Example you want a user to enter his/her name in JS var input = prompt("Enter your name:"); alert(input);
22nd Mar 2019, 8:36 AM
AU Hameed
AU Hameed - avatar
+ 1
If you use node.js you can use readline-sync
22nd Mar 2019, 9:35 AM
Blazy
Blazy - avatar
+ 1
Var Name = prompt("VEDANG"); Alert(Name );
23rd Mar 2019, 8:29 AM
Omar Khalil Bakhsh
Omar Khalil Bakhsh - avatar