Calculate the sum of two numbers, and return the result: - Javascript Function

Javascript examples for Function:Function Return

Description

Calculate the sum of two numbers, and return the result:

Demo Code

ResultView the demo in separate window

<!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>

Related Tutorials