Reference unordered list item as an array
I have an unordered list that I am using as a menu. This list contains sub lists.
I found out how to get the index of the primary unordered list item that is being hovered but I am not getting the syntax correct to reference the individual items of this list to get the HTML, the position, height and length of this item.
What would that statement look like? Thanks!
-
$(" #nav li").hover(function(){
-
// Locate the index of the singular list item that is being hovered
-
var index = $(this).parent().children('li').index(this);
-
-
// This is incorrect
-
var $itemObject = $(this).parent().children('li')[index];
-