title: clone subclass of class that :contains specific string
body: <p>I am trying to clone a specific subclass of a class that contains specific text but  can't find a way to do it. <strong>can't use :eq() or :firstchild  because there are multiple classes with  the same name and can change the order</strong> </p>
  
  <p>jquery I have been trying to select multiple classes</p>
  
  <pre><code> var rate = $(".header a").text()
  
  
    if  (t_hotelCode="zzzz")
    {
      if (rate == "Super")
      {
  
  
        $('.header a:contains("Super").policy').clone().insertAfter(".policy")
        $(".childrenPolicy").eq(1).each(function(){
        $(this).html($(this).html().replace('Policy', 'other'))
  });
      }
    }
  </code></pre>
  
  <p>if I  use the following it works but it clones every single class named <strong>policy</strong></p>
  
  <pre><code> var rate = $(".header a").text()
    if  (t_hotelCode="zzzz")
    {
      if (rate == "Super")
      {
    $('.Policy').clone().insertAfter(".Policy")
    $(".childrenPolicy").eq(1).each(function(){
    $(this).html($(this).html().replace('Policy', 'other'))
      });
      }
    }
  </code></pre>
  
  <p>HTML of class I  am trying to clone, I can only use string <i> <strong>h4 super h4</strong> </i> everything else changes</p>
  
  <pre><code>&lt;div id="roomsrates_list" class="ratelistview"&gt;
    &lt;div id="room_1" class="roomrate room closed"&gt;
      &lt;div class="header"&gt;
      &lt;div class="room" style="display:none;"&gt;
      &lt;div class="content"&gt;
        &lt;div class="rates"&gt;
          &lt;div id="room1_rate1" class="rate opened" relgross="" rel="" data-rrc="IC"&gt;
             &lt;div class="ratesperday hidden"&gt;
             &lt;div class="layerrateinfos hidden"&gt;
             &lt;div class="header"&gt;
                &lt;a class="iconbutton iconbutton1" href="#"&gt; &lt;/a&gt;
                &lt;h4&gt;Super&lt;/h4&gt;
                &lt;div class="rateicons"&gt;
                &lt;div class="price"&gt;
                &lt;div class="discountPrice"&gt; &lt;/div&gt;
                &lt;div class="clear"&gt; &lt;/div&gt;
             &lt;/div&gt;
             &lt;div class="border"&gt; &lt;/div&gt;
             &lt;div class="content" style=""&gt;
             &lt;p&gt;&lt;/p&gt;
             &lt;a class="details details" href="Javascript:void(0)"&gt;
             &lt;a class="details details_policies" href="Javascript:void(0)"&gt;
             &lt;div class="clear"&gt; &lt;/div&gt;
             &lt;div class="detailcontent_policies" style=""&gt;
               &lt;div class="depositPolicy"&gt;
                 &lt;strong&gt;Deposit&lt;/strong&gt;
                 &lt;br&gt;
                 &lt;p&gt;&lt;/p&gt;
                 &lt;br&gt;
              &lt;/div&gt;
             &lt;div class="cancellationPolicy"&gt;
             &lt;div class="checkinDescription"&gt;
             &lt;div class="Policy"&gt;
          &lt;/div&gt;
          &lt;div class="detail" style="display:none;"&gt;
          &lt;div class="clear"&gt; &lt;/div&gt;
       &lt;/div&gt;
     &lt;/div&gt;
   &lt;/div&gt;
  &lt;div class="clear"&gt; &lt;/div&gt;
  </code></pre>
  
  <p>
     </p>