Currently, I am attempting to track the number of times a button is clicked on a webpage. I have found a way to achieve this using the Firefox console. However, despite successfully incrementing my counter, the button no longer executes its original function. Below is the code snippet I am using:
var button = document.getElementById("buttonid"),
count = 0;
button.onclick = function() {
count += 1;
console.log(count);
};