Prev Demo
How To Create A Function That Accepts Parameter(S) And Return A Value In Javascript?
Next Demo
Write code here
J
|
B
|
A
<!DOCTYPE html> <html> <head> <title>Demo</title> </head> <body> <script> function Add(a, b) { var sum = a + b; return sum; } </script> <input type="button" id="btnTest" onclick="alert(Add(5, 6))" value="Sum" /> </body> </html>
Note: We DO NOT save your trial code in our database.
Output