I want to create a script that when I write a string to check if this string is a number or no if it isn't a number it should give me the input dialogue again, the is the code I tried:
<script>
var nombre;
nombre = parseInt(prompt("Donnez un nombre entre 0 et 999: "));
var nombreIsInt = false;
while(!nombreIsInt)
{
if(isNaN(nombre))
prompt("Svp Saisie un nombre entre 0 et 999: ");
else
nombreIsInt = true;
}
</script>
The problem is that when I write a number it gives me the input dialogue again.