title: jQuery run function only in a div that has anoher div with specific class
body: <p>Have code for example:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;div class=&quot;row&quot;&gt;
  
  &lt;div class=&quot;sblock4&quot;&gt;
  &lt;h4&gt;Product 1&lt;/h4&gt;
    &lt;div class=&quot;available&quot;&gt;product available&lt;/div&gt;
    &lt;div class=&quot;quckorder-btn&quot;&gt;Quick order&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class=&quot;sblock4&quot;&gt;
  &lt;h4&gt;Product 2&lt;/h4&gt;
    &lt;div class=&quot;available&quot;&gt;product available&lt;/div&gt;
    &lt;div class=&quot;quckorder-btn&quot;&gt;Quick order&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class=&quot;sblock4&quot;&gt;
  &lt;h4&gt;Product 3&lt;/h4&gt;
    &lt;div class=&quot;not_available&quot;&gt;out of stock&lt;/div&gt;
    &lt;div class=&quot;quckorder-btn&quot;&gt;Quick order&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;/div&gt;
  </code></pre>
  <p>Need to hide &quot;quick order&quot; button if parent div has inner div with class &quot;not_available&quot;</p>
  <p>tried some JavaScript:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script type=&quot;text/javascript&quot;&gt;
    jQuery(document).ready(function(){
      if(jQuery('div').hasClass('not_available')){
        jQuery('.quckorder-btn').css('display', 'none');
      }
    });  
  &lt;/script&gt; 
  </code></pre>
  <p>Another example JavaScript:</p>
  <pre class="lang-html prettyprint-override"><code>&lt;script type=&quot;text/javascript&quot;&gt;
    jQuery(document).ready(function(){
  if (jQuery('.sblock4:contains(&quot;out of stock&quot;)')) {
      jQuery(&quot;.quckorder-btn&quot;).addClass(&quot;hide-button&quot;);
  }
    });  
  &lt;/script&gt;  
  </code></pre>
  <p>But it or don't work at all, or work for all divs with class <code>.quckorder-btn</code>.
  Need run function only in a div that has another div with class &quot;not_available&quot;</p>
  <p>Appreciate any help. Thanks</p>