title: How to get name and name key from input that have array name
body: <p>here is html inputs :</p>
  <pre><code>&lt;input name=&quot;item[5689]&quot; type=&quot;text&quot; value=&quot;abcdefgh&quot;&gt;&lt;/input&gt;
  &lt;input name=&quot;item[6535]&quot; type=&quot;text&quot; value=&quot;abcd1&quot;&gt;&lt;/input&gt;
  &lt;input name=&quot;item[9856]&quot; type=&quot;text&quot; value=&quot;abcd&quot;&gt;&lt;/input&gt;
  </code></pre>
  <p>So need this type of array for post ajax call :</p>
  <pre><code>5689 =&gt; abcdefgh
  6535 =&gt; abcd1
  9856 =&gt; abcd
  </code></pre>
  <p>How it can be achieved by jquery ?</p>
  <p>here I try but not success :</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>$("input[name='item[^]']").each(function() {
    console.log("Name: " + this.name + ", index: " + $(this).index());
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;input name="item[5689]" type="text" value="abcdefgh"&gt;&lt;/input&gt;
  &lt;input name="item[6535]" type="text" value="abcd1"&gt;&lt;/input&gt;
  &lt;input name="item[9856]" type="text" value="abcd"&gt;&lt;/input&gt;</code></pre>
  </div>
  </div>
  </p>