<!DOCTYPE html>
<html lang="en" dir="ltr">
 
<head>
    <meta charset="utf-8">
    <title>
        How to get values from html input
        array using JavaScript ?
    </title>
</head>
 
<body style="text-align: center;">
     
    <h1 style="color: green;">
        GeeksforGeeks
    </h1>
 
    <h3 id="po">Input Array Elements</h3>
    <form>
        <input type="text" name="array[]" value="" /><br>
        <input type="text" name="array[]" value="" /><br>
        <input type="text" name="array[]" value="" /><br>
        <input type="text" name="array[]" value="" /><br>
        <input type="text" name="array[]" value="" /><br>
        <button type="button" name="button" onclick="Geeks()">Submit</button>
    </form>
    <br>
 
    

   <link rel="stylesheet" href="//apps.bdimg.com/libs/jqueryui/1.10.4/css/jquery-ui.min.css">
  <script src="//apps.bdimg.com/libs/jquery/1.10.2/jquery.min.js"></script>
  <script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
 
    <script type="text/javascript">
        
        var k;
        function Geeks() {
            var input = document.getElementsByName('array[]');
        k = input;

        k.forEach(myFunction);
        function myFunction(www) {
        var qqq=www.value;

        var xmlhttp=new XMLHttpRequest();
        xmlhttp.onreadystatechange=function() {  }
        xmlhttp.open("GET","registrabase/registro_gasto.php?TIPO_DOCUMENTO="+qqq,true);
        xmlhttp.send();

        }
  
        }

    </script>


</body>
 
</html>