I know I can get the name/value relationship by using
$(#form).serializeArray();
But is there a way to get the whole enchilada, type, name and value with one call?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Use
$("form :input")Per the docs:
Now to your question,
If you simply want to loop through the items,
But if you want to return some sort of structure, you can use
.map()Or if you simply want to get the elements
Example of this on jsfiddle