Document.write not working
<p>I have a javascript function to calculate total amount :</p>

<pre><code>&lt;script&gt;
function calculate(v)
{

    v = parseFloat(v);
    v = v + 19;
    //alert(v);
    document.write.getElementById("total") = v;

}

&lt;/script&gt;
</code></pre>

<p>which is within <code>&lt;head&gt;&lt;/head&gt;</code> section . I am calling this function from :</p>

<pre><code>Select amount you want to buy : &lt;input type="text" name="qty"  onkeyup="calculate(this.value)"/&gt; grams
</code></pre>

<p>And I am trying to display value of <code>v</code> here :</p>

<pre><code>&lt;div id="total"&gt;&lt;script&gt; document.write(v);&lt;/script&gt;&lt;/div&gt;
</code></pre>

<p>But it is not showing anything. Why?</p>
