以上是用jquery实现的:
$('li').hover(function(){
var parent=$(this).parents('*[id]').eq(0);//筛选有id属性的父级元素
alert(parent.html());
});