Suppose we choose the element var $el = $('.hi'); . so why not remove the class from this element? I do this - $el.removeClass('hi'); but zero reactions. Errors in the console does not issue. Maybe the browser is to blame? I use firefox de
$hi = $('.hi'); $hi = removeClass('hi'); (!$hi.hasClass('hi')) ? $hi.html('Удален') : $hi.html('Не удален'); <script src="https://code.jquery.com/jquery-3.2.1.min.js"></script> <div class="hi">Пример</div>