Chapter 8. Write Better JavaScript Scripts by Using Functions and Events

So far, your JavaScript code has consisted of a statement or a group of statements that are all run sequentially from top to bottom. This is great for simple scripts, but in most cases you don't want all your JavaScript to run when the page loads. You might want only a few statements to run at the beginning and then a few more at some other point in time. This is where functions come into their own.

This chapter teaches you about the following:

Get JavaScript™ 1.5 by Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.