I am having trouble creating this javascript problem:
“Create a web page called “wartime.html” that consists of a textarea and a button which reads “Shoot the Cannon Until Surrender”. If the button is clicked, the program enters a loop that repeatedly prompts the user “Do you surrender, yes or no?”. If the user types “yes” or “y”, add the phrase “The war is over” to the text area and exit the loop. If the user types anything else, add the phrase “BOOM” to the textarea and prompt again for surrender.”
This is what I have so far for my function:
War Time
function decide() { var n1 = prompt(“Do you surrender? Yes or no?”, “”); document.getElementById(‘battlefield’).v… var counter=0 while (n1 == yes) {document.getElementById(“battlefield”)…. += “The war is over!”} }
h2{text-align=center} p{text-align=center}
War Time!
I am unsure as to what I have to do to make the loop respond to the user’s input Holiday in Kashmir
Kashmir Tour Package