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

31st Oct 2017, 3:54 PM
Vishnu
2 Réponses
+ 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 ^^
31st Oct 2017, 4:02 PM
Dev
Dev - avatar
0
i already did this
31st Oct 2017, 4:04 PM
Vishnu