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

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

Leave a Comment