I have a line of html
<p>Guess #<span id="count">0</span>!</p>
I need to write a function that will increment the number within the <span> tags by 1 each time the #guessButton is clicked. A simple .replaceWith() method wont work because that doesn't count. I'm assuming I need a for loop.
So far I've got this:
$("#guessButton").click(function() {
addOne();
});
addOne() being the name of the function I will use to increment.
What javascript method can I use in the addOne() function to reference a number in the html and make it responsive?