Hi, 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
Hi, 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
You're close:
$$('input.required').each(function(i){
console.log($F(i));
});
All inputs with the class of required
will be iterated through and their value displayed to the Firefox console. If you don't use Firefox just change console.log
to alert
to see the results.