title: jquery optimal method of selecting in loop
body: <p>Im writing a function that gathers the inputs from a form. But there are many ways to select the inputs. I have looked around and cant find a specific answer based on the methods below.</p>
  
  <p>Is it possible to add multiple selections to a find() (incase i needed to gather input and dropdowns) like you can in a jquery selector?</p>
  
  <p>Which would be the most optimal and why?</p>
  
  <p>Any other alternatives?</p>
  
  <p><strong>jQuery</strong></p>
  
  <pre><code>//method 1: Id selector
  var formId = $('.modal.fade.in').find('form').attr('id');
  
  $('#' +formId+ ' input').each(function(input)
  {
       //gather values
  }
  
  //method 2: Object and find
  var form = $('.modal.fade.in').find('form');
  
  $(form).find('input').each(function(input)
  {
       //gather values
  }
  </code></pre>