Assignment 016

Functions

Functions are special, reusable chunks of code that save you lots of time. They are normally coded in the head section of a Web page and called by other objects when needed, through events. In this example, all the buttons below call the callMe() function when they are clicked. Therefore, the button's onClick events call the function callMe(). When the buttons are clicked, they send their name to the function. The function handles the window.alert.