title: Remove the appended div when unchecked
body: <p>I want to remove the appended div's  when a checkbox is unchecked, which appear on the top when a checkbox is checked  , but could not achieve the functionality.
  here is the fiddle 
  <a href="http://jsfiddle.net/tVYaE/33/" rel="nofollow noreferrer">http://jsfiddle.net/tVYaE/33/</a>    </p>
  
  <pre><code>$('input:checkbox').change(
                  function () {
                      if ($(this).is(':checked')) {
                          $('&lt;li /&gt;').appendTo('#div ul').text($(this).val());
                      }
                      else {
  
                          if ($('#div ul').has('&lt;li /&gt;')) {
                              $('&lt;li /&gt;').remove();
                          }
                      }
                  });
  </code></pre>