+ 3
How to take User inputs in Javascript instead of using prompt, alert, etc ??
Javascript user inputs
3 Answers
+ 8
Here is a simple example:
https://code.sololearn.com/WTXqRA74vGUz
+ 5
As what Jayden said, you could use the input tag in HTML to get the user to input something. From there, you could also have a submit button that runs a function which checks what the value of the input field is, giving the result of what the user had input.
+ 4
There are various ways, in Javascript, to get user input. Here's a simple example:
In your HTML:
<input id="someText">
Javascript code to get the input field's value:
document.getElementById("sometext").value;
Hope it helps.