title: How to concatenate strings from separate elements with jquery / javascript
body: <p>I am wanting to concatenate strings from 2 separate elements and have them stored in a variable.</p>
  
  <p>Currently my code is setting the variable equal to:
  "Daily: 1070300, Weekly: 1070300, Monthly: 1070300"</p>
  
  <p>My goal is to make the variable in the console equal to:
  "Daily: 10, Weekly: 70, Monthly: 300"</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>      $(document).ready(function() {
          var str = '';
          $('tbody &gt; tr').each(function() {
            $(this).find('.key').each(function() {
              str += $(this).text() + ": " + $(this).parents().siblings('tr').find('.value').text() + ", ";
            })
          });
          console.log(str);
        });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;table&gt;
    &lt;tbody&gt;
      &lt;tr&gt;
        &lt;th class="key"&gt;Daily&lt;/th&gt;
        &lt;th class="key"&gt;Weekly&lt;/th&gt;
        &lt;th class="key"&gt;Monthly&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
        &lt;td class="value"&gt;10&lt;/td&gt;
        &lt;td class="value"&gt;70&lt;/td&gt;
        &lt;td class="value"&gt;300&lt;/td&gt;
      &lt;/tr&gt;
    &lt;/tbody&gt;
  &lt;/table&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Thank you for your help all!</p>