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***

Below is the code that I have so far***************
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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
