I need to serialize a matched set so it's values can be passed to my rails app.
The matched set code is (returns the parent div of every uninitialized select element):
jQuery('select').filter(function(index){
return jQuery(this).val() == 0;}).closest('div')
for serialization I really only need the id of each matched element so I tried:
jQuery('select').filter(function(index){
return jQuery(this).val() == 0;}).closest('div').attr('id')
Unfortunatly attr()
only works on the first element in a matched set.
Since the resulting javascript will be sent via rails' remote_function :with
I believe javascript can only be one statement.
How can a matched set be serialized, or to-string'd?