title: jQuery append function and resizing
body: <p>I am attempting my first "progressive enhancement" site and have a question about jQuery append and browser resizing. Basically, I have it set up so that the default site that is loaded is the mobile version and then I have a jQuery function to append desktop elements to the divs on the page if the browser width is a minimum of 1100px. </p>
  
  <p>It works great but now I just need to tackle the resizing issues. Currently, if you resize the browser window below 1100px width, the elements that are appended to the divs do not disappear until you refresh the browser. I would like to make it so that if the browser window is resized below 1100px, the elements that were appended disappear without a refresh. </p>
  
  <p>Could someone point me in the right direction? Thanks!</p>
  
  <p>HTML:</p>
  
  <pre><code>&lt;div id="section1"&gt;
  
  &lt;/div&gt;
  </code></pre>
  
  <p>Javascript:</p>
  
  <pre><code>if (window.matchMedia("(min-width: 1100px)").matches) {
      $("#section1").append("\
          &lt;div class='placeholder'&gt;\
              &lt;img src='assets/site/desktop_placeholder.png' /&gt;\
          &lt;/div&gt;\
      ");
  }
  </code></pre>