jQuery – append(), remove(), empty()

 

<ul class=”dropdown-menu” id=”dropdown_menu”></ul>

<script>
      for (var i = 0; i <= dropdown_options_count; i++) {
          $(“#dropdown_menu”).append(‘<li id=”color-scheme-‘ + i + ‘”>color scheme ‘ + i + ‘</li>’);
      }
     
      $(“#dropdown_menu #color-scheme-5”).remove();

      $(“#dropdown_menu”).empty();

      $(“#dropdown_menu”).append(‘<li id=”color-scheme-3″>color scheme 3</li>’);
</script>