title: Get all input of form from a html-string with jQuery - No matter which level they are
body: <p>I want to extract out of an html string all forms and their input fields. In order to do this, I've written the following code:</p>
  
  <pre><code>var html = $.parseHTML("&lt;html&gt;&lt;form id="Form1"&gt;&lt;div&gt;&lt;input name="Input1"&gt;&lt;/div&gt;&lt;/form&gt;&lt;/html&gt;");
  $(html).find('form').each(function(e) {
      var FormElement = $(this);
  
      $(FormElement).find('input, textarea').each(function(e) {
          consolge.log($(this).attr('name') + " is an input field of a form with the the ID: " + $(FormElement).attr('id'));
      });
  });
  </code></pre>
  
  <p>Sadly, this extracts only the children input fields of the form. The input fields, which are in a div, which is in a form are not affected by the scanning.</p>
  
  <p>(working example: html -> form -> input)</p>
  
  <p>(not working example: html -> form -> div -> input)</p>
  
  <p>Any suggestions?</p>
  
  <p>Thanks in advance! :)</p>