Hi all, I have a ul and on hover I want to retrieve the id attribute of the li being hovered over. I have tried selecting the li and on hover I tried to retrieve the ID using the jquery 1.4.1 index function.
$("li").hover(
function(){
$('#articleimage').append(this.index(this.attr('id')));});
As a simple test, I even tried the following with no results.
$("li").hover(
function(){
var item = this.attr("id");
$('#articleimage').append(item);
}
);
If I am using the Index() function from jquery 1.4.1, I need to specify the ID which I do not know in the first place. This is why I want to harvest the ID on hover of any given li as this ID will be used to associate an image with that li.
Any ideas ?