O'Reilly logo
  • Ahmed Elgendy thinks this is interesting:

Oh, but we also need this code to run only after the DOM for the page has been created, so let’s use the window’s onload property to ensure that. We’ll place our code into a function, init, that we’ll assign to the onload property.


Cover of Head First JavaScript Programming


when is the DOM done creating? A tip: when the page is done downloading.