Javascript: While loop - looping forever
When I type "Yes" or "No" it alerts again and again. Please help.
<script type="text/javascript">
var y = prompt("Do you want to enter values, type 'Yes' or 'No'!");
while ((y.toUpperCase()!="YES") || (y.toUpperCase()!="NO"))
{
if (y.toUpperCase()=="YES")
{
alert(y);
}
else if (y.toUpperCase()=="NO")
{
alert(y);
}
else
{
alert("You have type \"" +y+ "\" which is no option! Please type again");
y = prompt("Do you want to enter values, type 'Yes' or 'No'!");
}
}
</script>