User input | Sololearn: Learn to code for FREE!


User input

How can we take user input in JavaScript

7/7/2020 6:06:40 PM

Suhaila Abdulkareem

4 Answers

New Answer


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 :)


Suhaila Abdulkareem welcome


Aditya Thank u😊