Javascript examples for Function:Function Return
Calculate the sum of two numbers, and return the result:
<!DOCTYPE html> <html> <body> <p id="demo"></p> <script> function myFunction(name) {//from w w w . j a v a 2s . c o m return "Hello " + name; } document.getElementById("demo").innerHTML = myFunction("Mary"); </script> </body> </html>