.removeClass not working, and preventing .addClass from working
<p>I'm having a hard time finding any information that helps with this issue. I've tried several other options that worked for other people on here, but it doesn't seem to be working.</p>

<p>I have a div set up like this:</p>

<pre><code>    &lt;div class="dynamic-content"&gt;
        &lt;div class="button"&gt;&lt;/div&gt;
        &lt;div class="content"&gt;&lt;/div&gt;
    &lt;/div&gt;
</code></pre>

<p>What I'm trying to do is apply a CSS animation to .dynamic-content when .button is clicked, by adding a specific class, and then removing that animation by clicking .button again and removing the specific class. </p>

<p>Here is my jQuery:</p>

<pre><code>    $(".button").on('click', function() {
        if ($(".dynamic-content").hasClass('open')) {
            $(".dynamic-content").removeClass('open'));
        } else {
            $(".dynamic-content").addClass('open'));
        }
    }
</code></pre>

<p>If I don't include the .removeClass() part, the addClass works perfectly. However, as soon as I put in the .removeClass, in the inspector, I can see .dynamic-content lighting up, as if targeted and acted on by JS, but nothing happens, not even .addClass is working. </p>