Javascript onChange sum input after percentage
<pre><code>&lt;form name="cost"&gt;
    &lt;table border="1"&gt;
        &lt;tr&gt;
            &lt;td&gt;Cost&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="cost" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Discount&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="discount" /&gt; (&lt;span id="discount2"&gt;&lt;/span&gt;)%&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
            &lt;td&gt;Net Cost&lt;/td&gt;
            &lt;td&gt;&lt;input type="text" name="net" /&gt;&lt;/td&gt;
        &lt;/tr&gt;
    &lt;/table&gt;
&lt;/form&gt;
</code></pre>

<p>Hello guys,
I really need a help of javascript programming. The process of the form are:</p>

<ol>
<li>Put a number of in Cost</li>
<li>Then put a number of discount (auto calculates span#discount2=cost*discount/100)</li>
<li>Net cost auto update = Cost-Discount</li>
</ol>

<p>I tried many times but have no luck plus lack of javascript knowledge. Please help.</p>
