DEFINING AND CALLING FUNCTIONS
SAMPLE FUNCTION DEFINITION
function FunctionName() {
Code goes here
}
EXAMPLE
PRACTICE
- Write a function that displays prompts the user for a word and then sets the title of the document and the status bar to the word. Call the function from an onclick event for a button.
- Create a page with two textboxes. Create a function that swaps the contents of the textboxes. Hint - you should store the innerHTML of one of the textboxes in the status bar or another element.
SELF-QUIZ