title: Toggle class in closest parent
body: <p>So I have this jquery that i need to make it work. But through all the parents() and children(), I can't get to where I want. </p>
  
  <p>My objective is when I click in the button, the class icon-cross, toggle to icon-tick.</p>
  
  <p>(In this snippet bellow, I made an example to explain better. In this case I want to change the color of the rectangle)</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>$(function() {
    $(".addOpt").click(function(e) {
      $(this).text(function(i, text) {
        return text === "Add" ? "Remove" : "Add";
      });
      $(this).toggleClass("btn-primary btn-remove");
      
      
      //the problem is the following line:
      $(this).closest(".quoteCompare").children(".quoteCompareInside").p.toggleClass("icon-tick icon-cross");
      
      
      e.preventDefault();
    });
  })</code></pre>
  <pre class="snippet-code-css lang-css prettyprint-override"><code>.icon-cross {
    width: 50px;
    height: 10px;
    background-color: green;
  }
  .icon-tick {
    width: 50px;
    height: 10px;
    background-color: red;
  }</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;div class="row "&gt;
    &lt;div class="medium-6 xsmall-12 small-12 column quoteCompare  "&gt;
      &lt;div class="quoteCompareInside quoteStandard sameHeight2"&gt;
        &lt;p class="icon-cross"&gt;&lt;/p&gt;
        &lt;p class="title noMarginBottom"&gt;10€&lt;/p&gt;
      &lt;/div&gt;
    &lt;/div&gt;
    &lt;div class="medium-6 xsmall-12 small-12 column quoteCompare  "&gt;
      &lt;div class="quoteCompareInside quoteStandard sameHeight2"&gt;
        &lt;div class="form-row valign"&gt;
          &lt;button type="button" class="btn btn-primary buttonOpt addOpt"&gt;Add&lt;/button&gt;
        &lt;/div&gt;
      &lt;/div&gt;
    &lt;/div&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>