how to add assign the value and make an addition in javascript
<pre><code>&lt;input name="" type="button" value="300" onclick="document.all.t1.value=this.value" /&gt;
&lt;input name="t1" type="text" id="t1"/&gt;&lt;br /&gt;

&lt;input name="" type="button" value="400" onclick="document.all.t2.value=this.value" /&gt;
&lt;input name="t2" type="text"  id="t2"/&gt;&lt;br /&gt;
&lt;script&gt;
function add(){
    document.getElementById("t3").value = Math.floor(document.getElementById("t1").value) +
                                          Math.floor(document.getElementById("t2").value);
}
&lt;/script&gt;

&lt;input name="" type="button" value="add" onclick="add" /&gt;
&lt;input name="t3" type="text" id="t3"/&gt;
</code></pre>

<p>the above code is bad., expect some to correct it. thank you.</p>

<p>when click 300, the 300 vill in the first textbox, the same as 400, then click add button. the third textbox shoew 700</p>
