Javascript : How to increase a fraction value in a textbox ? example: 0.10 to 0.11
<p>I need to increase a fraction in a text box
using javascript. </p>

<p>the goal is to add 1 penny until it is 0.99
and then it will be 1.00 and 1.01</p>

<p>how can this be done in javascript?</p>

<p>this is what is not working.</p>

<pre><code>var a;
a = document.getElementById('a1').value;
a = a+a;
alert(a);
</code></pre>

<p>alert returns</p>

<pre><code>0.100.10
</code></pre>

<p>Additional Info</p>

<pre><code>var a;
a = parseFloat(document.getElementById('b13').value);
a = a+a;
alert(a);
</code></pre>

<p>returns</p>

<pre><code>0.2
</code></pre>

<p>i would rather see  0.20</p>

<p>but most importantly, how do increase this by 0.01 at a time ?</p>

<p><strong>SOLVED:</strong></p>

<p>both</p>

<pre><code>var a;
a = parseFloat(document.getElementById('a1').value);
a = a+0.01;
alert(a);
}
</code></pre>

<p>and ...</p>

<pre><code>document.getElementById('a1').value = +document.getElementById('a1').value + 0.01
</code></pre>

<p>worked fine.</p>
