IT3049C 3049C
HTML CODE: < html > < head > < title > IT3049CModule3 </ title > < link rel = 'stylesheet' href = 'style.
View the step-by-step solution to:






  <title>IT3049C Module 3</title>

  <link rel="stylesheet" href="style.css">



<h1>Rock, Paper, Scissors</h1>

<div id="welcomeScreen">

  Welcome to our game... Rock, Paper, Scissors! Please press the start button to begin.


  <button id="startButton">Start</button>


<div id="gameScreen" class="hidden">

<h2>Please select your choice...</h2>

  <form id="gameForm">

    <select id="userChoice">

    <option value="rock">ROCK</option>

    <option value="paper">PAPER</option>

    <option value="scissors">SCISSORS</option>


  <input type="submit" value="BOOM!">



  <script src="index.js"></script>




"use strict";

//Variables used...

const startButton = document.getElementById("startButton");

const welcomeScreen = document.getElementById("welcomeScreen");

const gameScreen = document.getElementById("gameScreen");

const gameForm = document.getElementById("gameForm");



    console.log("User clicked the start button!!!");




gameForm.addEventListener("submit" , function(gameFormSubmitEvent){

    const userChoice = document.getElementById("userChoice").value;

    console.log("User :" + userChoice);  



function user(){

    console.log("User: " + userChoice)

    var computerOpt = Math.random();

        if(computerOpt < 0.34)  {

            computerOpt = "rock";

        }else if(computerOpt <= 0.67)  {

            computerOpt = "paper"


            computerOpt = "scissors";


        console.log("Computer :" + computerOpt);



        function compare(c1c2){

            if(c1 === c2){

                return "The result is a tie!";


            if(c1 ==="rock"){

                if(c2 === "scissors"){

                    return "rock wins";


                    return "paper wins";



            if(c1 === "paper"){

                if(c2 === "rock"){

                    return "paper wins";


                    return "scissors wins";



            if(c1 === "scissors"){

                if(c2 === "rock"){

                    return "rock wins";


                    return "scissors wins";





Hi, im not getting any output after the user selection being displayed on the screen.

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.


Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes