What is the jquery equivalent to: document.forms[0].elements[i].value;?
I don’t know how to travel through a form and its elements in jQuery and would like to know how to do it.
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.
The usual translation is the
:inputselector:The
:firstis because your example pulls the first<form>, if there’s only one or you want all input elements, just take the:firstoff. The:inputselector works for<input>,<select>,<textarea>…all the elements you typically care about here.However, if we knew exactly what your goal is, there’s probably a very simple way to achieve it. If you can post more info, like the HTML and what values you want to extract (or do something else with).