title: jquery add/remove same dropdown options with feed in another div
body: <p>Basicly I want to create dynamic dropdown menu, where if user selects an option, it goes under the dropdown and later on the user can remove it, by clicking 'remove' button and the option goes back into dropdown. I have already created that if user selects an option, it goes under the dropdown menu. Also, I have figured out how to remove the same option. Where I start to expierience problems:</p>
  
  <p>1) I can't figure out how to add the same option back in dropdown, after user clicks on remove button
  2) If there are more than one option selected, it adds back to dropdown list more than a single option.</p>
  
  <p>Here's my code and jsfiddle:
  <a href="https://jsfiddle.net/wjybpLuk/" rel="nofollow">https://jsfiddle.net/wjybpLuk/</a></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>    $('#dropdown_test').click(function() {
        if ($(this)[0].selectedIndex == 0) {
          //do nothing
        } else {
          $("#selected_options").append('&lt;div class="selected_lang"&gt;' + $('option:selected', this).val() + ' &lt;a class="remove_lang" href="javascript:(0)"&gt;Remove&lt;/a&gt;' + "; " + '&lt;/div&gt;');
          $('option:selected', this).remove();
          $("#dropdown_test").val($("#dropdown_test option:first").val());
        }
  
        $('.remove_lang').click(function() {
          $(this).closest('.selected_lang').remove('.selected_lang');
  
          $('#dropdown_test').append('&lt;option&gt;' + $('.selected_lang', this).html() + '&lt;/option&gt;');
        });
      });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"&gt;&lt;/script&gt;
  
  &lt;form&gt;
    &lt;label for="dropdown_test"&gt;Select me&lt;/label&gt;
    &lt;select id="dropdown_test"&gt;
      &lt;option selected disabled value="default"&gt;Select...&lt;/option&gt;
      &lt;option value="lang01"&gt;lang01&lt;/option&gt;
      &lt;option value="lang02"&gt;lang02&lt;/option&gt;
      &lt;option value="lang03"&gt;lang03&lt;/option&gt;
      &lt;option value="lang04"&gt;lang04&lt;/option&gt;
    &lt;/select&gt;
    &lt;div id="selected_options"&gt;
  
    &lt;/div&gt;
  &lt;/form&gt;</code></pre>
  </div>
  </div>
  </p>