title: Iterate to div to get different input field and post it to controller
body: <p>I have a main div that have class models and in this div I have different input type I want to iterate through main div with class models and get the the different input fields and post it to my controller but end up with this error. ReferenceError: getElementsByClassName is not defined</p>
  
  <pre><code>$("#Visitor-form").on("submit", function () {
                      //Code: Action (like ajax...)
                      var slides = getElementsByClassName("models");
                      console.log(slides);
                      for (i = 0; i &lt; slides.length; i++) {
  
                          var previsitor = [
                              { NIC: slides[0].value, V_Name: slides[0].value }
                          ];
                      }
                      previsitors = JSON.stringify({ 'things': previsitor });
  
                      $.ajax({
                          contentType: 'application/json; charset=utf-8',
                          dataType: 'json',
                          type: 'POST',
                          url: '/PreVisitor/addMultipleVisitor',
                          data: things,
                          success: function () {
                              $('#result').html('"Pass List&lt;PreVisitor&gt;" successfully called.');
                          },
                          failure: function (response) {
                              $('#result').html(response);
                          }
                      });
  
                  })
  </code></pre>