- 1

I am writing a program that will add two number and I have a sample... Is it correct ?

<html> <body> <p id ="element"></p> <script> function simpleFunction(a,b) { return a+b } document.getElementById("element").innerHTML=simpleFunction(1,4) </script> </body> </html>

9th Jun 2019, 9:11 AM
Raveena Bora
Raveena Bora - avatar
5 Réponses
+ 3
Your code appears to be incomplete. Please use code playground to link codes for easy reproducibility. From a brief scan if the remaining html tags were added </script></body></html> It would work fine. Specify and share the complete code if it doesn't.
10th Jun 2019, 5:53 PM
Lord Krishna
Lord Krishna - avatar
+ 2
Why don't you run it and verify.
9th Jun 2019, 9:41 AM
Mohammad Fahad Sayed
Mohammad Fahad Sayed - avatar
+ 2
Yes,Mohammad!
9th Jun 2019, 9:44 AM
CodeFu
CodeFu - avatar
+ 1
I cant believe it!?
9th Jun 2019, 11:10 PM
Logomonic Learning
Logomonic Learning - avatar
0
I edited it and it worked
11th Jun 2019, 1:28 PM
Raveena Bora
Raveena Bora - avatar