- Joined
- Apr 4, 2010
- Messages
- 1,013
So i recently got into Coding in java, and right now im making a simple little program for the sake of practice, but im stuck on something.
What i want to do is make the else condition loop back to the "if (response...)", but i just cant figure out how to do it without repeating the code a bunch of times. Any help is appreciated
<html>
<head>
<script type/"javascript")>
var response = prompt("yes or no?")
if (response === "yes") {
document.write("You Chose yes")
}
else if (response === "no") {
document.write("You Chose no")
}
else{
prompt("Please chose one of the options available. yes or no?")
}
</script>
</head>
</html>
What i want to do is make the else condition loop back to the "if (response...)", but i just cant figure out how to do it without repeating the code a bunch of times. Any help is appreciated
















