How to think of Javascript-is this accurate?
<p>I'm working through some javascript examples, and I just did this one:</p>

<pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head&gt;
&lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /&gt;

&lt;title&gt;Page title&lt;/title&gt;
&lt;script type="text/javascript"&gt;
function displayText()
{
document.getElementById('targetDIV').innerHTML =  "You're using Javascript";
}
&lt;/script&gt;

&lt;/head&gt;
&lt;body onload="displayText()"&gt;
&lt;h2&gt;This should be before the other text.&lt;/h2&gt;

&lt;div id="targetDIV"&gt;
&lt;/div&gt;

&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>OK.  Very basic, I know-but I realized I was confused about the "why" of some things.  Could it be accurate to say that:</p>

<p>Function=<strong>WHAT</strong> will happen.</p>

<p>The call (the body onload...)= <strong>WHEN</strong> it will happen.</p>

<p>and div id="targetDIV" = <strong>WHERE</strong> it will happen</p>

<p>I know this is the case in this example, but in general is that the way things work in Javascript?</p>
