I want to iterate over an array of inputs that belong to certain class (eg.”required”). How can I traverse it and get their values ? Something like
$$('input required').invoke(function(e){
alert(?input value?)
});
thanks
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.
You’re close:
All inputs with the class of
requiredwill be iterated through and their value displayed to the Firefox console. If you don’t use Firefox just changeconsole.logtoalertto see the results.