I want to load the multiplication result of 1st and 2nd input text in the 3rd input text before clicking the submit portion of the form (all the values in the input texts will be numeric)

I tried with this code but something is worng here

<script type="text/javascript">
function myfunc() {
var a = document.my.n1.value;
var b = document.my.n2.value;
var c = a*b;
return c;
<form name="my" method="post">
<input type="text" name="n1"/>
<input type="text" name="n2"/>
<input type="text" onChange="myfunc()"/>
<input type="submit" />