0
How can I use the input from user after he/she enters information via JavaScript prompt?. Especially to use it on the same page
Incorporation of user input in web development
5 ответов
+ 1
Use this snippet
if(!isNaN(parseInt(input))&&isFinite(input)) {
setTimeout(()=>{
//TODO: Animation
},1000) //will perform the provided animation after 1s
}
+ 2
You can just store the value returned (the user input) by the prompt in a variable.
var input = prompt("enter something");
console.log(input) // logs the user input
+ 1
Please Seniru Pasan , if I want to ensure only numerics are entered. And then to use the number as number of seconds to display an animation, what's the best way to do this?
0
Thank you Seniru Pasan
0
Thanks again.