<div id='pop'>
     <div class='me'>first</div>
    <div>
              <div class='me'>second</div>
    </div>
    <div>
              <div>
                      <div class='me'>third</div>
              </div>
    </div>
</div>
<button onclick="test()">test</button>
<div id="result"></div>
function test(){

  $r = $("#pop").find(".me");
  $( $r ).each(function(index) {

    let num  = ++index;
    let htm = $("#result").html();
    $("#result").html(htm + 'Номер '+num+':'+$( this ).text()+'<br>');

  });
}

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

  1. https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js