I have a form to add many contacts in html the input is two dimensional array here is the form:
<input class="form-control" type="text" name="account[0][name]" placeholder="Name" autocomplete="off" />
<input class="form-control" type="text" name="account[0][email]" placeholder="Email" autocomplete="off" />
<input class="form-control" type="text" name="account[0][mobile]" placeholder="Mobile" autocomplete="off" />
<input class="form-control" type="text" name="account[1][name]" placeholder="Name" autocomplete="off" />
<input class="form-control" type="text" name="account[1][email]" placeholder="Email" autocomplete="off" />
<input class="form-control" type="text" name="account[1][mobile]" placeholder="Mobile" autocomplete="off" />
I am trying to get the value using jqueryI tried the following, it returns the value but i want to return an input value of account name or account email or account mobile
$('input[name^="account"]').each(function() {
console.log($(this).val());
});