title: Javascript foreach input in form for Name and Value
body: <p>I am just practicing some javascript and i used to use JQuery a lot! I have had no major experience with raw javascript and i want to learn it just as i did JQuery. I have a simple form and a javascript function to go with it onsubmit and i want to get the name and value of each input in the form with my function but it doesnt seem to work can someone help me out?</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;title&gt;Foreach Practice&lt;/title&gt;
      &lt;script type="text/javascript"&gt;
          function Get() {
              var Form = document.getElementById('Form');
              for(I = 0; I &lt; Form.length; I++) {
                  var Value = this.attribute('name').value;
                  alert(Value);
              }
          }
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  &lt;form id="Form" onsubmit="return false;"&gt;
      &lt;input type="text" name="User" placeholder="Username" /&gt;
      &lt;input type="password" name="User" placeholder="Password" /&gt;
      &lt;input type="submit" name="Submit" onclick="javascript:Get();" /&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>