title: Get UL list content with jquery
body: <p>I need to get content from a UL list and then be able to use that to email.  But I'm stuck on getting the ul list in jquery.  I've searched and found the following:</p>
  
  <pre><code>$(document).ready(function(){
      $("#send").click(function() { //When trigger is clicked...
              var optionTexts = [];
              $("#thelist").each(function() { optionTexts.push($(this).text()) });
              var text = '"' + optionTexts.join('"&lt;br/&gt; "') + '"';
  
              $("#result").append(text);
  
          });
      });
  </code></pre>
  
  <p>but this returns all contents inside the page :S
  Here's my ul list:</p>
  
  <pre><code>&lt;ul id="thelist"&gt;
    &lt;li style="height: 65px; display: list-item; "&gt;
      &lt;ul&gt;
        &lt;li class="botHeader"&gt;
          "Evelin dice"
                  &lt;span&gt;14:37:52&lt;/span&gt;
        &lt;/li&gt;
        &lt;li class="botMsg"&gt;
          "Hola, bienvenido"
        &lt;/li&gt;
      &lt;ul&gt;
    &lt;/li&gt;
    &lt;li style="height: 26px; display: list-item; "&gt;
      &lt;ul&gt;
        &lt;li class="userHeader"&gt;
          "Usted dice"
                  &lt;span&gt;14:37:59&lt;/span&gt;
        &lt;/li&gt;
        &lt;li class="userMsg"&gt;
          "Hola como estas"
        &lt;/li&gt;
      &lt;ul&gt;
    &lt;/li&gt;
    &lt;li style="height: 39px; display: list-item; "&gt;
      &lt;ul&gt;
        &lt;li class="botHeader"&gt;
          "Evelin dice"
                  &lt;span&gt;14:37:59&lt;/span&gt;
        &lt;/li&gt;
        &lt;li class="botMsg"&gt;
          "Gracias por preguntar, todo bien"
        &lt;/li&gt;
      &lt;ul&gt;
    &lt;/li&gt;
  &lt;/ul&gt;
  
  &lt;a href="#" id="send"&gt;enviar&lt;/a&gt;
  &lt;div id="result"&gt;
  
  &lt;/div&gt;
  </code></pre>