title: Jquery .each, remove $(this)?
body: <p>Assume a jquery <code>.each</code> loop:</p>
  
  <pre><code>function reverifyDiscounts() {
      //everything we need to verify a discount is already on the page. 
      //we'll remove the "bad" discounts when we submit the page
      console.info("Entering reverification");
      //event discounts are always valid once they're on the page because it's for the event
      $(".discountPromoItem").each(function () {
          //skip events
          if ($(this).attr("appliesto") == $("#hdnEventID").val()) {
              return true;
          }
          //we just need to make sure that the checkbox that the appliesto attribute references is checked!
          if (!$("checkbox[attribute$='" + $(this).attr("applitesto") + "']").is(":checked")) {
              //we also need to remove the promo code from the list of promo codes entered into the hidden textboxes
              $("#hdnAppliedPromoCode").val($("#hdnAppliedPromoCode").val().replace($(this).attr("code"), ""));
              //the item that it applies to is no longer selected and the promo must be removed
              $(this).remove(); //can't remove $(this) while inside the loop for whatever reason.
          }
      });
      recalculate();
  }
  </code></pre>
  
  <p>Why does <code>$(this).remove()</code> fail or am I doing something wrong? </p>