title: getElementsByTagName multiple tags
body: <p>I want get all my input and select elements off my page HTML. I've tried <code>getElementsByTagName('input,select')</code> but it does not work.</p>
  
  <p>My code HTML and JavaScript:</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>function myFunction() {
  var data =  [];
  var data1 = [];
  var data2 = [];
  for (var i = 0; i &lt; 10; ++i) {
  
    
  var x = document.getElementsByTagName("INPUT,SELECT")[i].getAttribute("name"); 
  var y = document.getElementsByTagName("INPUT,SELECT")[i].getAttribute("type");
  var z = document.getElementsByTagName("INPUT,SELECT")[i].getAttribute("maxlength");
    data.push(x);
    data1.push(y);
    data2.push(z);
    location.href ="ttt.php?name=" + data + "&amp;active=" + data1 + "&amp;data2=" + data2
  }  
  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;select name="CIV"&gt;&lt;option selected="selected" value=""&gt;&lt;/option&gt;&lt;option selected="selected" value=""&gt;Mr&lt;/option&gt;&lt;option selected="selected" value=""&gt;Mme&lt;/option&gt;&lt;/select&gt;
  &lt;input type="text" size="20" name="first_name" id="first_name" maxlength="50" class="cust_form" value=""&gt;
  &lt;input type="text" size="20" name="last_name" id="last_name" maxlength="50" class="cust_form" value=""&gt;
  &lt;input type="text" size="20" name="address3" id="address3" maxlength="50" class="cust_form" value=""&gt;</code></pre>
  </div>
  </div>
  </p>