title: How to get multidimensional array from an array of inputs
body: <p>I have the following setup:</p>
  
  <pre><code>&lt;input name="myInput[3][0]" type="text"&gt;
  &lt;input name="myInput[3][1]" type="text"&gt;
  &lt;input name="myInput[4][0]" type="text"&gt;
  &lt;input name="myInput[4][1]" type="text"&gt;
  </code></pre>
  
  <p>With php it is pretty easy to access the values after the form has been submitted. For example using a "post"-method the values of the inputs are stored in the multidimensional array <code>$_POST['myInput']</code>. Then the first element in each dimension can be accessed with <code>$_POST['myInput'][3][0]</code>.</p>
  
  <p>Is there a similar functionality in JavaScript that can be used even without submitting a form via the "post"-method?</p>
  
  <p>Following <a href="https://stackoverflow.com/questions/14321862/javascript-get-value-from-multiple-inputs-in-an-array">JavaScript - get value from multiple inputs in an array</a>, I added a class called "myInput" to each <code>input</code>-element, like</p>
  
  <pre><code>&lt;input name="myInput[3][0]" type="text" class="myInput"&gt;
  </code></pre>
  
  <p>Then I tried this:</p>
  
  <pre><code>var myInput= document.getElementsByClassName('myInput');
  </code></pre>
  
  <p>But, unsurprisingly, this gives me only a 1-dimensional array not respecting any of the array keys. So not exactly the result sought for. (Also it seems odd to fiddle around with classes.)</p>