Functions Explained

The custom functions used for the event handlers in the previous examples were mostly void functions that don't take any parameters.
Recall that terminology from the built-in functions example earlier in this lesson.
Void means the function doesn't return a value.
No paramaters means you don't send any information to the function, just call it with empty () like my_function().

For the sake of completeness in this lesson, this example demonstrates some custom JavaScript functions that return values and/or take parameters.

The two links below have custom onclick event handlers that call the SAME function, but send it different names. See the source code. Click me for a cool animal name     Click me for another cool animal name

The second example uses a custom click event to trigger a prompt window.

Click me

The final example shows how functions are called over and over again inside loops.
You will have to see source code.