User input | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 3

User input

How can we take user input in JavaScript

7th Jul 2020, 6:06 PM
Some Name
Some Name - avatar
3 Réponses
+ 8
In JavaScript, we can get user input like this: var name = window. prompt("Enter your name: "); alert("Your name is " + name); The code above simply prompts the user for information, and the prints out what they entered in. Hope it was clear :)
7th Jul 2020, 6:19 PM
Aditya
Aditya - avatar
7th Jul 2020, 6:21 PM
Aditya
Aditya - avatar
+ 3
Aditya Thank u😊
7th Jul 2020, 6:20 PM
Some Name
Some Name - avatar