title: jQuery remove() not removing element
body: <p>I have some code that removes an item and adds the 3 letter 'app-code' to a cookie, the site then reads this cookie to not draw it next time.</p>
  
  <p>I'm trying to write the code so that the item is removed from the DOM when the user clicks the 'hide button' (which is inside the div I'm trying to remove).</p>
  
  <p>JavaScript</p>
  
  <pre><code>$('.HideLinkButton').click(function(e){
  e.preventDefault();
  var enabled = $(this).hasClass('ButtonToggled');
  var favoured = $(this).closest('.Item a').hasClass('btn-favourite');
  if (!favoured) {
      if (enabled) {
          removeHiddenLink($(this).closest('.Item').data('application-code'));
          //$(this).removeClass('ButtonToggled');
          $(this).closest('.Item a').removeClass('Hidden');
          $(this).closest('.Item').remove();
  
          //Adds hidden to class
          $(this).closest('.Item a').addClass('Hidden');
          $(this).closest('.Item').addClass('Hidden');
  
          //Removes element completely
          $(this).children('.Item').remove();
  
      } else {
          //Adds application code to 'hidden'cookie.
          addHiddenLink($(this).closest('.Item').data('application-code'));
  
          //Adds 'buttontoggled' to HideButton div.
          $(this).addClass('ButtonToggled');
  
          //Removes element completely
          $(this).children('.Item').remove();
      }
  }
  </code></pre>
  
  <p>});</p>
  
  <p>For some reason, the last .remove() line doesn't function</p>
  
  <p>I'm talking about this one:</p>
  
  <pre><code>$(this).children('.Item').remove();
  </code></pre>
  
  <p>When I refresh the page, the item is gone. This is because it has put the app-code into the 'hidden' cookie, so the C# script knows not to write it to the screen.</p>
  
  <p>It just doesn't remove the element when clicked.</p>
  
  <p>I can't find anything online, or any reason why this shouldn't work.</p>
  
  <p>Thanks!</p>