May 6, 2013

Function that returns a value

Coding

<html>
<head>
<script language="JavaScript">
function myFunction()
{
return ("Hello, have a nice day!")
}
</script>
</head>
<body>
<script language="JavaScript">
document.write(myFunction())
</script>
<p>The script in the body section calls a function.</p>
<p>The function returns a text.</p>
</body>
</html>

No comments:

Post a Comment

Popular Posts

Views