javascript - Targeting $(this) within nested for each loops in jQuery -


i'm trying figure out, when iterating through list items, how target each "$(this)" equivalent within nested foreach loops. here example of problem:

$('li').each(function(){         // believe $(this) target each li item...     $(this).children("li").each(function(){         // ... how can target each of these li items? doesn't $(this) target original loop?     }); }); 

$('li').each(function(){     var $this = $(this);     $this.children("li").each(function(){         $this; // parent li         this; // child li     }); }); 

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -