title: get only text from element
body: <p>I have this :</p>
  
  <pre><code>var y = $(document.getElementById('{{ forloop.counter }}')).text();
  console.log(y)
  </code></pre>
  
  <p>In my console i have this :</p>
  
  <pre><code>My text1
  
            var y = $(document.getElementById('1')).text();
            console.log(y)
  My text2
  
            var y = $(document.getElementById('2')).text();
            console.log(y)
  </code></pre>
  
  <p>How can i get just <code>My text</code>, without funcs.
  Tried <code>.textContext</code> but console shows that the element <code>undefined</code></p>
  
  <p>UPD</p>
  
  <pre><code>&lt;div class="span4 collapse-group"&gt;
      &lt;div class="text-center"&gt;
        &lt;p&gt;&lt;a class="btn btn-md btn-outline-dark btn-square" href="#"&gt;Check &amp;raquo;&lt;/a&gt;&lt;/p&gt;
      &lt;/div&gt;
      &lt;div class="collapse"&gt;
        &lt;div class="card card-body"&gt;
          {{text}}
          &lt;script&gt;
          $(".card").each(function(i,e){
    var text = $(e).text();
    console.log(text);
  });
  </code></pre>