jQuery: selecting a span with a particular id
<p>I'm getting an error message on this function telling me that parseInt doesn't have a radix parameter, even though I'm passing it the variable moveCount. I assume this means that the value of the span with the id #moveCount is not being assigned to the variable moveCount. I've marked the line below where I think the problem's arising. I've tried this line</p>

<pre><code>moveCount = $('span #moveCount').html();
</code></pre>

<p>both with and without using the word 'span' in the selector and am getting the same result. </p>

<pre><code>function incrementMoveCount() {
    //gets the html of the span with id
    //moveCount
    //turns it into a number
    //increments it by one
    //sets the html of the span with id moveCount
    //to the new move count
    var moveCount = 0; 
    var newMoveCount = 0;
    moveCount = $('span #moveCount').html();   # problem here
    newMoveCount = parseInt(moveCount);
    newMoveCount = newMoveCount + 1; 
    $('span #moveCount').html('newMoveCount');
}
</code></pre>

<p>html</p>

<pre><code>&lt;div id="meta"&gt;
&lt;h1&gt;Checkers&lt;/h1&gt;
&lt;h4&gt;Moves: &lt;span id="moveCount"&gt;0&lt;/span&gt;&lt;/h4&gt;
&lt;/div&gt;
</code></pre>
