Hi I'm looking for some advice on how I would make this switch statement into a do loop.both string function and number function execute other programs and have to be executed until 3 is pressed. any help would be greatly appreciated.
function Menu()
{
var menu =0;
document.write(" menu options " + name + "<br>");
document.write("option 1 stringFunction<br>");
document.write("option 2 numberFunction<br>");
document.write("option 3 goodbye<br>");
menu = prompt("please select a number between 1 and 3",0);
menu = parseInt(menu)
switch (menu)
{ // begin switch
case 1:
// begin case 1
document.write(name + " This is option 1<br> ") ;
stringFunction()
break ;
// end case 1
case 2:
// begin case 2
document.write(name + " This is option 2<br>") ;
numberFunction()
break ;
// end case 2
case 3:
// begin case 3
document.write('Goodbye ' + name) ;
break ;
// end case 3
default :
{// begin default
alert ("You must choose either 1,2,or 3");
}
} // end switch
} // end function