I'm attempting to consolidate several similar functions into one, but I'm encountering some challenges.
Below is an example of one of the original functions that is called by a button press:
function ADD_ONE(Variable_Name){
Variable_Name += 1;
document.getElementById(Variable_Name).innerHTML = Variable_Name;
};
Here is my attempt at the replacement:
function ADD_ONE(Variable_Name){
Variable_Name += 1;
document.getElementById(Variable_Name).innerHTML = Variable_Name;
};
However, this resulted in an error:
ref(v1.0).html:744 Uncaught TypeError: Cannot set property 'innerHTML' of null
at ADD_ONE
I believe it's likely a simple mistake that I'm overlooking, but being relatively new to Javascript, I would appreciate any guidance.