Multiple parents with the same class with siblings with the same classes
<pre><code>&lt;div class="example"&gt;
  &lt;div class="test"&gt;Some text&lt;/div&gt;
  &lt;div class="whatever"&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;div class="example"&gt;
  &lt;div class="test"&gt;Some more text&lt;/div&gt;
  &lt;div class="whatever"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>How can I make each <code>.example</code>'s <code>.whatever</code> contain the contents of its <code>.test</code>?</p>

<p>For example, if the code were just this:</p>

<pre><code>&lt;div class="example"&gt;
  &lt;div class="test"&gt;Some text&lt;/div&gt;
  &lt;div class="whatever"&gt;&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Then I could just do this:</p>

<pre><code>$('.whatever').text($('.test').text());
</code></pre>

<p>But I have multiple elements with the class <code>.whatever</code> and multiple elements with the class <code>.test</code>, and each <code>.test</code> contains different text.</p>

<p>So in other words, how can I make every element with the class <code>.whatever</code> contain the text of the element <code>.test</code>, but only the element <code>.test</code> that is in the sample <code>.example</code> element?</p>

<p>Sorry for the confusing wording.</p>
