here is html inputs :
<input name="item[5689]" type="text" value="abcdefgh"></input>
<input name="item[6535]" type="text" value="abcd1"></input>
<input name="item[9856]" type="text" value="abcd"></input>
So need this type of array for post ajax call :
5689 => abcdefgh
6535 => abcd1
9856 => abcd
How it can be achieved by jquery ?
here I try but not success :
$("input[name='item[^]']").each(function() {
console.log("Name: " + this.name + ", index: " + $(this).index());
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<input name="item[5689]" type="text" value="abcdefgh"></input>
<input name="item[6535]" type="text" value="abcd1"></input>
<input name="item[9856]" type="text" value="abcd"></input>