title: Select a button inside a div using jQuery
body: <p>Here is the GSP code where in which I am making a call to the Java Script function.</p>
  
  <pre><code>&lt;div class="approval-container row"&gt;    
      &lt;div class="col-xs-6 col-md-5"&gt;
          &lt;div class="btn-group" role="group"&gt;
              &lt;button type="button" class="btn byop-yes-button" onclick="test1($(this))"&gt;Yes&lt;/button&gt;
              &lt;button type="button" class="btn byop-no-button" onclick="test2($(this))"&gt;No&lt;/button&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="approval-email-container row"&gt;
          &lt;div class="col-xs-6 col-md-5"&gt;
              &lt;div class="btn-group" role="group"&gt;
                  &lt;button type="button" name="button1" disabled="true" class="btn email-yes-button1" onclick="test3($(this))"&gt;ABC&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Here is the jQuery code logic:</p>
  
  <pre><code>function test1(button) {
  
          $(button).closest('.approval-container').find('.approval-email-container button[name="button1"]').addClass('btn-default');
  
  }
  </code></pre>
  
  <p>Searched for the similar posts but it is not working for me. Your help is highly appreciated.</p>