May 6, 2013

Function with arguments that return a value

Coding

<html>
<head>
<script language="JavaScript">
function total(numberA,numberB)
{
return numberA + numberB
}
</script>
</head>
<body>
<script language="JavaScript">
document.write(total(2,3))
</script>
<p>The script in the body section calls a function with two arguments, 2 and 3.</p>
<p>The function returns the sum of these two arguments.</p>
</body>
</html>

No comments:

Post a Comment

Popular Posts

Views