The onload event occurs when an object has been loaded. The onload event for the body (or window) fires after all objects in the DOM hierarchy (images, ...) have finished loading and the document object has been built up. At that point, you can access the elements of the document (such as getElementById, getElementsByName), you can manipulate the contents of the document, etc.
There are some other events related to the onload event: onreadystatechange, DOMContentLoaded, onbeforeunload, onunload.
For further details and examples please see the following page: