Assign the 'onmouseover' event handler
<p>Please tell me what is wrong with this code:</p>

<pre><code> &lt;script type="text/javascript" &gt;

function createimg()
       {
         var img = new Image();
       img.src='link/to/image';
       img.alt='Next image';  img.id = 'span1'; img.style.zIndex = 10;
       img.style.position = 'absolute';  img.style.display='block'; img.style.top = '130px';
       img.style.padding='10px'; img.style.left='440px';    img.className ='dynamicSpan';
        document.body.appendChild(img);
        return img;
        }

    function al()
    {
     alert('loaded');
    }
   a = createimg();

    a.onmouseover = al();

&lt;/script&gt;
</code></pre>

<p>In specific the last part, where I'm trying to assign the 'onmouseover' event handler of a, which is an image element.  It does not assign this event handler for some reason and just executes the function on page load instead.</p>

<p>What is wrong?</p>

<p>Tony</p>
