Create In your HTML:a heading that says "Play Rock Paper Scissors"a paragraph underneath it with an input tag and a button in it. The paragraph should say "How many games would you like to play?" then the input, then a button that says "choose number of games"another paragraph that contains three buttons, one that says Rock, one that says paper, one that says scissorsa table with 2 rows and 3 boxes in each rowA paragraph that says "Games to play"A paragraph that says "0"Style it up nicely so it looks goodYou are done when you have all of this
Question
Create In your HTML:a heading that says "Play Rock Paper Scissors"a paragraph underneath it with an input tag and a button in it. The paragraph should say "How many games would you like to play?" then the input, then a button that says "choose number of games"another paragraph that contains three buttons, one that says Rock, one that says paper, one that says scissorsa table with 2 rows and 3 boxes in each rowA paragraph that says "Games to play"A paragraph that says "0"Style it up nicely so it looks goodYou are done when you have all of this
Solution
Sure, here is the HTML code for your requirements:
<!DOCTYPE html>
<html>
<head>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f0f0f0;
}
.container {
width: 80%;
margin: auto;
padding: 20px;
}
table, th, td {
border: 1px solid black;
border-collapse: collapse;
padding: 10px;
text-align: center;
}
button {
margin: 5px;
padding: 10px;
font-size: 16px;
}
input {
margin: 5px;
padding: 10px;
font-size: 16px;
}
</style>
</head>
<body>
<div class="container">
<h1>Play Rock Paper Scissors</h1>
<p>How many games would you like to play?
<input type="number" id="gameCount" min="1">
<button id="chooseGameCount">Choose number of games</button>
</p>
<p>
<button id="rock">Rock</button>
<button id="paper">Paper</button>
<button id="scissors">Scissors</button>
</p>
<table>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
</table>
<p>Games to play</p>
<p>0</p>
</div>
</body>
</html>
This HTML code creates a webpage with a heading "Play Rock Paper Scissors", a paragraph with an input field and a button, another paragraph with three buttons for Rock, Paper, Scissors, a table with 2 rows and 3 columns, and two paragraphs with the texts "Games to play" and "0". The elements are styled for a better look.
Similar Questions
make a variable outside of all functions called numGamesdefine another function called setNumberOfGames. Attach it to the button for choosing the number of games. It should find the input where the user chose their number of games, and store the number in numGamesIt should also put that number in the innerHTML of the paragraph on the bottom of the page.Go back to the takeTurn function. In it, every time the function is called, the numGames variable should go down by 1 and the new value should go in the paragraph at the bottom of the pageYou are done if the button set the number at the bottom of the page, and clicking rock, paper, or scissors, reduces that number by 1 each time.
rt 2Make the following variables (all of them should be OUTSIDE OF EVERY FUNCTION ON TOP OF MAIN.JS), along with the variables I left for you containing images: computerNumber, start it with -1 or any other numberdefine a function and attach it to each of your buttons (and/or to the user hitting the enter key). Call it takeTurn. This function should take a parameter. 1 for rock, 2 for paper, 3 for scissors:each button should have a function call with a different number passed in as a parameter based on how the function should expect numbersIn the function, reassign computerNumber to a random number between 1 and 3 (use randomInt() )Also put two alerts, one to show the user's number (representing which button they pushed) and one to show the computer's random numberYou are done when the alert in the function works correctly
remove the alert from part 2, you don't need it anymoremake a variable outside of all functions called numGamesdefine another function called setNumberOfGames. Attach it to the button for choosing the number of games. It should find the input where the user chose their number of games, and store the number in numGamesIt should also put that number in the innerHTML of the paragraph on the bottom of the page.Go back to the takeTurn function. In it, every time the function is called, the numGames variable should go down by 1 and the new value should go in the paragraph at the bottom of the pageYou are done if the button set the number at the bottom of the page, and clicking rock, paper, or scissors, reduces that number by 1 each time.
Create In your HTML:a heading that says "Crack the combo"three paragraphs underneath it. Each has an an input tag followed by the word "first number", "second number" , "third number"a paragraph with a button that says "guess"A small heading saying "Number of guesses"A small heading saying "0"A small heading saying "Numbers right"A slightly larger heading underneath that which says "- - - -" and will be changed each time to tell the user how many numbers they got rightStyle it up nicely so it looks goodYou are done when you have all of this
ApplyingCreate a simple HTML page with a title, heading, paragraph, and image.Create a table with three rows and four columns.Create a form with three input fields and a submit button.Create a link to another HTML page.Create a frame that displays a different HTML page.
Upgrade your grade with Knowee
Get personalized homework help. Review tough concepts in more detail, or go deeper into your topic by exploring other relevant questions.