Jquery - accessing an element is giving null
<p>I have page a where product and its image are loaded in a table.The image is initially hidden,and onmouseover I want to display the image.The image is inside a div tag,and productname is shown as a link.In the onready function,I attach event handler to the link,</p>

<pre><code>$('a').each(function()
    {
        if( $(this).attr('id').match(/prod/)) 
        {
            $(this).mouseover(display());
        }
    });
</code></pre>

<p>and in the eventhandler(a function called display) I am calling</p>

<pre><code>function display()
{
    $('div').each(function()
    {
        if( $(this).attr('id').match(/sx/)) 
        {
            alert("hi")
        }
    });
}
</code></pre>

<p>But, I am getting an error $("div") is null</p>

<p>HTML is:</p>

<pre><code> &lt;table&gt;
 &lt;tr&gt;&lt;td&gt;&lt;a href="link"&gt;product name&lt;/a&gt;&lt;/td&gt;
   &lt;td&gt;&lt;div class='.hidden'&gt;&lt;table&gt;&lt;tr&gt;&lt;td&gt;&lt;img   src=""&gt;&lt;/img&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;&lt;/div&gt;&lt;/td&gt;&lt;/table&gt;
</code></pre>
