title: Deleting element jquery
body: <p>I'm noob in programming, 
  i searched for a solution but but to no avail,
  The script does not work when i add </p>
  
  <pre><code>else
  </code></pre>
  
  <p>instruction. What is wrong?</p>
  
  <pre><code>$(function () {
      $(window).scroll(function () {
  
          var popID = "popup1";
          var popWidth = "44%";
          var popHeight = "30%";
  
          if ($(this).scrollLeft() &lt;= 500) {
  
              $("#container").append('&lt;div id="drawing"&gt;&lt;/div&gt;');
              $("#drawing").css("background-color", "#f04").animate({
                  top: '84%',
                  left: '10%'
              });
  
              //Fade in the Popup and add close button
              $('#' + popID).fadeIn().css({
                  'width': String(popWidth),
                  'height': String(popHeight)
              }).prepend('&lt;a href="#" class="close"&gt;&lt;img src="close_pop.png" class="btn_close" title="Close Window" alt="Close" /&gt;&lt;/a&gt;');
  
              //Fade in Background
  
              $('body').append('&lt;div id="fade"&gt;&lt;/div&gt;'); //Add the fade layer to bottom of the body tag.
  
              $('#fade').css({
                  'filter': 'alpha(opacity=80)'
              }).fadeIn(); //Fade in the fade layer 
  
              return false;
          };
  
          else if ($(this).scrollLeft() &gt;= 600) {
              $('#war').remove()
          }
  
          //Close Popups and Fade Layer
  
          $('body').click(function () { //When clicking on the close or fade layer...
  
              $('#fade, a.close').fadeOut(function () {
                  $('#fade, .popup_block').remove();
              }); //fade them both out
              return false;
          });
      });
  });
  </code></pre>