controling what the user inputs in prompt
hello everybody, does any one of you knows how to prevent the user from writing a string in the prompt?
#1:you have to clearly state in the prompt,that the user has to input something that isnt a string like a number. #2:convert your prompt() from string to your required datatype like parseInt(prompt()); or you could just <input type="number"/> This forces a numeric keyboard on the user
You mean, something else than numbers? Cause the user always inputs a string.
no, I mean he have to put numbers only