0
Write a program Sum of two number within form?
form tag use and JavaScript also use https://code.sololearn.com/W12234Wazl3M/?ref=app https://code.sololearn.com/W12234Wazl3M/?ref=app
2 Antworten
+ 8
// Ever tried the parseFloat or parseInt functions? The value which we get from our input tag is in the form of Strings initially, we use parseFloat to convert it to a floating-point number and then it can be easily added!
function myfun()
{
var x,y,z;
x=parseFloat(document.getElementById("one").value);
y=parseFloat(document.getElementById("two").value);
z=x+y;
document.write(z);
}
// P.S. That was just a suggestion ^^
0
i already did this