title: JavaScript - get value from multiple inputs in an array
body: <p>I am trying to get the value from muliple inputs with the same id in an array.
  I already used the forum, but haven't find a solution for me.</p>
  
  <p>Exmaple</p>
  
  <pre><code>&lt;input type="hidden" value="'+image_url+'" name="webcampics[]" id="webcampics"&gt;
  &lt;input type="hidden" value="'+image_url+'" name="webcampics[]" id="webcampics"&gt;
  &lt;input type="hidden" value="'+image_url+'" name="webcampics[]" id="webcampics"&gt;
  &lt;input type="hidden" value="'+image_url+'" name="webcampics[]" id="webcampics"&gt;
  
  
    var elem = document.getElementById("webcampics");
    var names = [];
    for (var i = 0; i &lt; elem.length; ++ i) {
       names += elem[i]+'|';
    }
    var webcamval = names;
  </code></pre>