title: Jquery .addClass and .removeClass Not Working?
body: <p>I wrote a code that clicking an item displays a context menu like div to enabling user to cut and paste a list item, I added disabled class to buttons in div that are related to paste operation. but when something selected I want to remove the class 'disable' to enable paste buttons. the code is as below:</p>
  
  <p><strong>html:</strong></p>
  
  <pre><code>&lt;div id="contextMenu" class="text-center" style="display: none; z-index: 1001; width: 242px;box-shadow:#D3D3D3 0px 0px 10px 4px; background-color: #FDFFC7; padding: 15px;"&gt;
  &lt;a class="btn btn-primary" style="margin: 3px 6px 3px 0px;" href="#" id="cut"&gt;&lt;i class="fa fa-cut fa-lg"&gt;&lt;/i&gt; Kes&lt;/a&gt;
  &lt;div class="btn-group" style="margin: 3px 0px 3px 6px;"&gt;
      &lt;button type="button" class="btn btn-success disabled" id="InsertInto" title="Kestiğini kategoriyi seçtiğiniz kategorinin içine yapıştırır."&gt;&lt;i class="fa fa-paste fa-lg"&gt;&lt;/i&gt; Yapıştır&lt;/button&gt;
      &lt;button type="button" class="btn btn-success dropdown-toggle disabled" data-toggle="dropdown"&gt;&lt;span class="caret"&gt;&lt;/span&gt;&lt;/button&gt;
      &lt;ul class="dropdown-menu" role="menu"&gt;
          &lt;li&gt;&lt;a href="#" title="Seçtiğiniz kategorinin Üstüne ekler" id="AddAbove"&gt;&lt;i class="fa fa-level-up fa-lg"&gt;&lt;/i&gt; Üstüne Ekle&lt;/a&gt;&lt;/li&gt;
          &lt;li&gt;&lt;a href="#" title="Seçtiğiniz kategorinin Altına ekler" id="AddBelow"&gt;&lt;i class="fa fa-level-down fa-lg"&gt;&lt;/i&gt; Altına Ekle&lt;/a&gt;&lt;/li&gt;
      &lt;/ul&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p><strong>JS:</strong></p>
  
  <pre><code>$(document).on('click', '.ContextMenu', function () {
      event.preventDefault();
  
      var anySelected = $('.selected').length;
  
      if (anySelected &gt; 0) {
          $("button", "#contextManu").removeClass('disabled');
      }
  
      var widgetPosition = $('#contextMenu').parent().offset();
  
      $('#contextMenu').css('position', 'absolute');
      var currentPosition = $(this).offset();                
  
      var contextLeft = (currentPosition.left) - $('#contextMenu').width() - widgetPosition.left - 10;
      var contextTop = (currentPosition.top + 80) - widgetPosition.top;
      $('#contextMenu').css('left', contextLeft);
      $('#contextMenu').css('top', contextTop);                
  
      $('#contextMenu').slideDown(300);
  
      $selectedListItem = $(this).parents('div.categoryItemContainer').parent();
  
  
  });
  </code></pre>
  
  <p>I Trace code using google chrome browser, $("button", "#contextManu") founds two button in the contextMenu div but not changes it.</p>