admin管理员组

文章数量:1130349

I am very new to JavaScript and HTML. I am trying to get a 2 player rock, paper, scissors game where the first player chooses an option and then afterwards the second player will choose an option. I am having troubles linking the player1 and player2 together to enable me to use if and else statements effectively. I am not sure if I am using functions correctly either.

This is what I've done so far...

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width", intial-scale="1.0"/>
<title> Two Player Rock, Paper, Scissors</title>    
<link href="style.css" rel="stylesheet">
</head>
<body>
<h1>2 Player Rock, Paper, Scissors</h1>
<div id="playerChoose">Player 1 Please Choose: </div>
<div class="player1Choices">
    <button id="rock" onclick="playGame('Rock')">

I am very new to JavaScript and HTML. I am trying to get a 2 player rock, paper, scissors game where the first player chooses an option and then afterwards the second player will choose an option. I am having troubles linking the player1 and player2 together to enable me to use if and else statements effectively. I am not sure if I am using functions correctly either.

This is what I've done so far...

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width", intial-scale="1.0"/>
<title> Two Player Rock, Paper, Scissors</title>    
<link href="style.css" rel="stylesheet">
</head>
<body>
<h1>2 Player Rock, Paper, Scissors</h1>
<div id="playerChoose">Player 1 Please Choose: </div>
<div class="player1Choices">
    <button id="rock" onclick="playGame('Rock')">

本文标签: javascript2 player rockpaperscissors gameStack Overflow