?
I am suppose to write a function that uses a while loop that prompts the user for only 9 char and may not include spaces. What im doing is not even showing the prompt. Help
function Secret()
{
var secretcode = prompt(“Enter Po’s secret word. It must contain exactly 9 characters and there can be no empty spaces:”,””);
var code=secretcode.indexOf(” “);
var space==true;
while(space==false)
{
if (code.indexOf(” “)>=”0”)
{
space==true;
document.getElementById(“results”).innerHTML += (secretcode);<!–output the result of what was imputed for the secret word–>
}
if (code.indexOf(9)==/d)
{
space==false;
secretcode= prompt(“Please reenter Po’s secret word. It must contain exactly 9 characters and there can be no empty spaces:”,””);
}
else
document.getElementById(“results”).innerHTML += (secretcode);<!–output the result of what was imputed for the secret word–>
else
secretcode= prompt(“Please reenter Po’s secret word. It must contain exactly 9 characters and there can be no empty spaces:”,””);
}