title: How to get the values from dynamically created rows and store all the column and row values in an array
body: <p>This is the HTML code</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
  &lt;head&gt;
      &lt;title&gt;Tasklist&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
      &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
      &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"&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;/table&gt;
      &lt;/div&gt;
      &lt;script src="https://code.jquery.com/jquery-1.12.4.js"&gt;&lt;/script&gt;
      &lt;script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"&gt;&lt;/script&gt;
      &lt;script src="script.js"&gt;&lt;/script&gt;
  &lt;/body&gt; 
  &lt;/html&gt;
  </code></pre>
  
  <p>This is the Javascript for that code</p>
  
  <pre><code>var status;
  var sno = [];
  var load;
  var no_rows = 0;
  var row;
  $(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&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;/td&gt;&lt;td&gt;" + "&lt;input type=text class=comment&gt;&lt;/input&gt;" + "&lt;/td&gt;&lt;/tr&gt;";
          $("table").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");
                  }
              })
              ++no_rows;
      });
  
      $('.load').click(function () {
         //What should I write here
      });
  });
  </code></pre>
  
  <p>After clicking the enter button I need to load all the rows and columns in an array and display it in the console. For example if we created a table with two rows, the columns specified here is constant that is 6. The final output should be inside the arrays with two rows and 6 column within it. </p>