Reputation: 6728
I've got a script using mootools 1.1 to handle an Ajax "form" that has does something like this to get an idea of how many rows are in the (dynamically created) form before actually handling them:
form_rows = $$('#form_row'); // X can be anywhere from 4-20
console.log(form_rows.length); // in moo 1.1 this returns X-- with moo 1.2 it returns 1
Reading the moo 1.2 docs, it looks like this should work the same in either case-- but moo 1.2 always returns only the first "form_rows" element, not all of them.
Can anyone explain why?
Thanks for any help.
Upvotes: 0
Views: 108
Reputation: 186662
#form_row
implies an ID. There can only be one unique ID per page. Assign and select classes if you need multiple els.
Upvotes: 1