After I made some changes to the CSS of my game, I started encountering a variable error every time I clicked a button that called a function. The error message says it cannot find the variable.
Even though I removed the CSS, the game is still not functioning properly. I am unable to identify the issue, so I have included a link for you to download the code.
The error:
reference error: can't find variable: duckClick
Related JavaScript:
var ducks = 0;
function duckClick(number){
ducks = ducks + number;
document.getElementById("ducks").innerHTML = ducks;
Despite calling duckClick
, I am receiving an error indicating that it cannot be found.
<button onclick="duckClick(1)">Find Duck</button>