How do you combine JavaScript code and html code together?
<p>I am newer to Javascript and HTML. I want to check whether an image is loaded or not. I found this code on StackOverflow,but I don't know how to combine them into a finished piece:
Any one can tell me?</p>

<p>The js code:</p>

<pre><code>&lt;script language="JavaScript"&gt;
    $("img").one("load", function() {
      // do stuff
    }).each(function() {
      if(this.complete) $(this).load();
    });
    &lt;/script&gt;;
</code></pre>

<p>The html code:</p>

<pre><code>&lt;div&gt;
  &lt;table width="100%" height="100%" align="center" valign="middle"&gt; 
    &lt;tr&gt;
       &lt;td bgcolor="258cca"&gt;&lt;td align="center" valign="middle"&gt;
         &lt;p&gt;
            &lt;img src="http://www.freeiconspng.com/uploads/cute-ball-stop-icon-png-1.png"&gt;
         &lt;/p&gt;
         &lt;p class="STYLE1 STYLE2"&gt;&lt;/p&gt;
      &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;&lt;/tr&gt;
  &lt;/table&gt;
  &lt;BODY ondragstart="return false;" ondrop="return false;"&gt;
 &lt;/div&gt;
</code></pre>

<p>The CSS:</p>

<pre><code>body {
    background-color: #558CCA;
}
.STYLE1 {
    color: #FFFFFF;font-family: Arial, Helvetica, sans-serif;font-size: 30px;
}
.STYLE2 {
    font-size: 21px;
}  
</code></pre>