I want to get values of the input element that those elements are under the same name, name=\"items[]\"
for example:
...
Or use jQuery's map function:
$("div input[name='items[]']").map( function() { return $(this).val(); } ).get();
var values = [];
$("input[name='items[]']").each(function() {
values.push($(this).val());
});
JavaScript only:
var values = [];
var fields = document.getElementsByName("items[]");
for(var i = 0; i < fields.length; i++) {
values.push(fields[i].value);
}
Warning, see: getElementsByName in IE7