How to increment variable that is stored in variable with Javascript?
<p>I have large block of html that is stored in a variable that contains a variable that should increment upon function.</p>

<p>Seems like this is very basic, yet couldn't figure out.</p>

<pre><code>var x = 1,
    foo = '&lt;p&gt;This should count ' + x +'&lt;/p&gt;';

$('#add').click(function () {
    $('#form-dynamic').append(form);
    x++;
});
</code></pre>