jQuery Select by ID with variable
<p>I have some code that creates some span tags and each span has its own ID</p>

<pre><code>counter1
counter2
counter4
</code></pre>

<p>by its name in the database.
Now I'm trying to reach the value of one of them. So, I tried something like this:</p>

<pre><code>var id = // Any number that have a span.
var Counter = $("#counter" + id).val();
alert(Counter);
</code></pre>

<p>But, it's just showing "NaN"</p>
