1
JavaScript Inputs
MattyB10 (0)

How do you do inputs in JavaScript? On the internet it says to use a prompt() method but that never works. If you could help that would be great. Thanks.

You are viewing a single comment. View All
Answered by GavHern (62) [earned 5 cycles]
View Answer
1
Vandesm14 (486)

You can use prompt() to get input from the user. To actually persist the data, make sure you store the results into a variable: var userInput = prompt("What is your name?");

Please mark this as answered if I helped your problem 👍

1
MattyB10 (0)

@Vandesm14

I tried using the "var userInput..." but it says prompt is not defined. I included the picture below, if it is not accessible let me know. Again thank you so much for the help.