+ 4

How to take Input In JavaScript?

as we take "cin" in C++ and as we take public static void main (int a) in java. so how i can take Input from the user in JavaScript please explain me in detail.

27th Dec 2017, 4:33 PM
🩋FEATHER🩋
🩋FEATHER🩋 - avatar
2 Answers
+ 5
var input=prompt("enter anything");
27th Dec 2017, 4:37 PM
᠌᠌Code X
᠌᠌Code X - avatar
+ 4
Running this code will bring a pop-up displaying alert anything,soo...anything you enter will be the value of variable "input"
27th Dec 2017, 4:38 PM
᠌᠌Code X
᠌᠌Code X - avatar