Function Functions are chunks of code.Let's created a simple function:
function test()
{
document.write("Hello can you see me?");
}
Note that if only this were within your <script></script>
tags, you will not see "Hello can you see me?" on your screen because
functions are not executed by themselves until you call upon them.
So we should do something:
function test()
{
document.write("Hello can you see me?");
}
test();
Last line"test()" calls the function, now you will see the
words "Hello can you see me?".
|