title: Jquery - Get the text of multiple spans with the same class?
body: <p>I'm relatively new to jquery, so I have what I hope will be a simple question.
  I need to append multiple spans to the line items in an unordered list.<br>
  Essentially, each line item contains a  and I need to grab the content of that span and append it to the bottom of the line item it's contained in.  Here's what I have so far:</p>
  
  <p><strong>My jquery code:</strong></p>
  
  <pre><code>$("ul").ready(function () {
      var Name = $(".name").text();
      var Content = $(".content").text();
      $("li").append("&lt;span class=\"additional\"&gt;&lt;a href=\"/addinfo.php\"&gt;" + Name + "'s additional info&lt;/a&gt;&lt;/span&gt;");
  });
  </code></pre>
  
  <p><strong>The original HTML it needs to modify:</strong></p>
  
  <pre><code>&lt;ul&gt;
      &lt;li&gt;
          &lt;span class="name"&gt;John Doe&lt;/span&gt;&lt;br /&gt;
          &lt;span class="content"&gt;John is an excellent Swimmer&lt;/span&gt;&lt;br /&gt;
      &lt;/li&gt;
      &lt;li&gt;
          &lt;span class="name"&gt;Jane Doe&lt;/span&gt;&lt;br /&gt;
          &lt;span class="content"&gt;Jane loves to play basketball&lt;/span&gt;&lt;br /&gt;
      &lt;/li&gt;
  &lt;/ul&gt;
  </code></pre>
  
  <p><strong>Here's the output I'm getting:</strong></p>
  
  <ul>
  <li><p>John Doe<br />
  John is an excellent Swimmer<br />
  John DoeJane Doe's additional info</p></li>
  <li><p>Jane Doe<br /> 
  Jane loves to play basketball<br />
  John DoeJane Doe'sadditional info</p></li>
  </ul>
  
  <p><strong>Here's the desired outcome:</strong></p>
  
  <ul>
  <li><p>John Doe<br /> 
  John is an excellent Swimmer<br />
  John Doe's additional info</p></li>
  <li><p>Jane Doe <br />
  Jane loves to play basketball <br />
  Jane Doe's additional info</p></li>
  </ul>
  
  <p>As you can see, instead of taking the all the "Name" var's and putting them together, instead of just using the "Name" var of that line item.
  I'm sure it needs some type of this, $(this), or .each call on it, but I can't seem to find this in the documentation anywhere.</p>
  
  <p>Can someone help?
  Thanks!
  Troy</p>