Welcome to the 19th Easy JavaScript tutorial, part of EasyProgramming.net. Let's learn about onload
.
Web pages load from top to bottom - this means that code on top is executed before code at the bottom. If your JavaScript code is meant to touch your HTML, but it loads BEFORE the HTML loads, it will NOT run properly. It will not be able to find the DOM elements it is supposed to affect.
There are a few ways around this, and below, we explore the options. Let's take a look!
Your Name is ____. The city in which you live is ____.