[jQuery] Extract the function signature from a list collection
On a page, I have a list of dynamically generated image links 1, 2.. N
that are displayed on the page as follows:
<div class="imgBg">
<img id="imgProd" src="" alt=""/>
</div>
<div id="imgEnum">
<ul>
<li><span class="sqr1"
onmouseover="updImage('Images/aaa.01.jpg');">1</span></li>
<li><span class="sqr1" onmouseover="updImage('Images/aaa.02.jpg');">
2</span></li>
...
<li><span..>N</span></li>
</ul>
</div>
Clicking on an image index causes the image to be displayed in div
'imgProd' via js function updImage(). (This works fine):
function updImage(imgUrl){
document.getElementById("imgProd").src=imgUrl;
}
Problem: On loading, I would like the first image of the list to be
copied to imgProd via jquery. How do I extract the mouseover function
signature of the first item ie. "updImage('Images/aaa.01.jpg');" ?
I tried filtering out the list and narrow it to the first span item in
the hope of extracting the function signature, but I am stuck since js
debugging is not supported in VWD Express 2008:
jQuery(document).ready(function() {
$("#imgEnum > ul > li span").get(0);
var $this = $(this);
//alert(document.getElementById("this.id").innerHTML);
});
Thanks for any hints.