title: How to populate un-selected values one dropdown to another dropdown in table?
body: <p>how to populate un-selected dropdown options in table dropdown? and how to get all values in array console?</p>
  
  <p>Im tried but im little struggled with this</p>
  
  <blockquote>
    <p>Note: Un-selected options only shown in table dropdown lists</p>
  </blockquote>
  
  <p>here is my sample code..</p>
  
  <p><strong><a href="https://jsfiddle.net/joelshah/yk9zf0c2/" rel="nofollow noreferrer">FIDDLE HERE..</a></strong></p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var status;
  var sno = [];
  var load;
  var no_rows = 0;
  var row;
  var mainArr = [];
  var tmpArr = [];
  
  function loadValues() {
    var mainTable = $('#tablemain');
    var tr = mainTable.find('tbody tr');
    console.log(tr.length)
    tr.each(function() {
      tmpArr = [];
      $(this).find('td').each(function() {
  
        var values = $(this).find('input, select').val();
        tmpArr.push(values);
  
      });
      mainArr.push(tmpArr);
    });
    console.log(mainArr);
  }
  
  
  $(document).ready(function() {
    $(".add-row").click(function() {
      row = "&lt;tr id=tasklist&gt;&lt;td&gt;" + "&lt;input type=text class=sno&gt;&lt;/input&gt;" + "&lt;/td&gt;&lt;td&gt;" + "&lt;input type=text class=pname&gt;&lt;/input&gt;" + "&lt;/td&gt;&lt;td&gt;" + "&lt;input type=text class=task&gt;&lt;/input&gt;" + "&lt;/td&gt;&lt;td&gt;" + "&lt;input type=text class=date&gt;&lt;/input&gt;" + "&lt;/td&gt;&lt;td&gt;" + "&lt;select class=status id=dropdown2 name=dropdown2&gt;&lt;option &gt;Not Started&lt;/option&gt;&lt;/select&gt;" + "&lt;/td&gt;&lt;td&gt;" + "&lt;input type=text class=comment&gt;&lt;/input&gt;" + "&lt;/td&gt;&lt;/tr&gt;";
      $("table &gt; tbody").append(row);
      $('.date').datepicker();
      //  $('.sno').css("background-color","blue");  
      $("select").change(function() {
        status = $(this).find('option:selected').text();
        if (status === "In progress") {
          $(this).css("background-color", "#a1a1ff");
          //$('.task').addClass("blue");
        }
        if (status === "Finished") {
          $(this).css("background-color", "#54c654");
          //$('.task').addClass("green");
        }
        if (status === "Not Started") {
          $(this).css("background-color", "#F8F8F8");
          //$('.task').addClass("white");
        }
      })
      i++;
    });
  
    $('.load').click(function() {
      loadValues();
    });
  });
  
  $('select[name=dropdown1]').on('change', function() {
    $("select[name=dropdown2]").find('option').show();
    var from = $(this).find(":selected").val();
    $("select[name=dropdown2]").val('');
    if (form != "") {
      $("select[name=dropdown2]").find('option:contains("' + form + '")').hide();
    }
  })</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;div&gt; First Dropdown:
    &lt;select class="status" id="dropdown1" name="dropdown1"&gt;
      &lt;option&gt;Not Started&lt;/option&gt;
      &lt;option&gt;In progress&lt;/option&gt;
      &lt;option&gt;Finished&lt;/option&gt;
    &lt;/select&gt;
  &lt;/div&gt;
  &lt;div&gt;
    &lt;form&gt;
      &lt;input type="button" class="add-row" value="Add Row"&gt;
      &lt;input type="button" class="load" value="Enter"&gt;
    &lt;/form&gt;
    &lt;table id='tablemain' class="table"&gt;
      &lt;thead&gt;
        &lt;tr&gt;
          &lt;th&gt;SNo&lt;/th&gt;
          &lt;th&gt;Name&lt;/th&gt;
          &lt;th&gt;Assigned Task&lt;/th&gt;
          &lt;th&gt;Due Date&lt;/th&gt;
          &lt;th&gt;Status&lt;/th&gt;
          &lt;th&gt;Comments&lt;/th&gt;
        &lt;/tr&gt;
      &lt;/thead&gt;
      &lt;tbody&gt;
      &lt;/tbody&gt;
    &lt;/table&gt;
  &lt;/div&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <blockquote>
    <p>Note: Un-selected options only shown in table dropdown lists</p>
  </blockquote>
  
  <p>Thankyou</p>