Question: Create a function (outside the jQuery ready function) which increments the user's score when called and updates the HTML in span#score. Hint: You should create

Create a function (outside the jQuery ready function) which increments the user's score when called and updates the HTML in span#score. Hint: You should create a global variable to keep track of the score. Call your score increment function within Document Ready for testing purposes. ***I need to 0 pts to update to 20 pts***

Create a function (outside the jQuery ready

Below is the code that I have so far***************

Whack-A-Mole (CSCI2447)

var mole='';

var score = $('#score');

$(document).ready(function(){

$("#gamespace").html(mole);

$("#timer").show();

$("#start_button").click(myFunction);

function myFunction(){

alert("Okay");

alert(getX()+","+getY());

}; //end alert

}); //end.ready

function getY(min, max){

var y=Math.floor((Math.random()*300)+1);

return y;

}; //end y

function getX(min, max){

var x=Math.floor((Math.random()*600)+1);

return x;

}; //end x

function displayScore(){

score.innerHTML= ;

}; //end score

Whack-A-Mole

After clicking "start", you will have 30 seconds to click

as many moles as you can. The moles appear randomly so be ready!

0 pts

30 seconds left

Whack-A-Mole After clicking "start",you will have 30 seconds to click as many moles as you can. The moles appear randomly so be ready! o pts 30 seconds left

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!