Hi, 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,
$('a').each(function()
{
if( $(this).attr('id').match(/prod/))
{
$(this).mouseover(display());
}
});
and in the eventhandler(a function called display) I am calling
function display()
{
$('div').each(function()
{
if( $(this).attr('id').match(/sx/))
{
alert("hi")
}
});
}
But, I am getting an error $("div") is null
HTML is:
<table>
<tr><td><a href="link">product name</a></td>
<td><div class='.hidden'><table><tr><td><img src=""></img></td></tr></table></div></td></table>