I have very little experience with writing javascript and I need help desperately. I need to make so that when a button is clicked the score goes up by one similar to how the co
It'd be best code-organization-wise to define this function separately:
var incrementCount = function(){
clicks++;
}
And then to call that from your onclick:
And even better, it'd be smart to get rid of all of your inline javascript (AKA "obtrusive" javascript) alltogether, and make an object that will respond to all click events on all of these types of buttons automatically, but that may be above your level at the moment.
You can add this to an external JS file that you include, and make a new "counter" object that automatically fires when the user clicks your button object.