each iterates over the elements of a given array. Since a string is an array
of characters (try alert(bar[1]) if you don't believe it), each is
iterating over each character. Maybe try splitting the classes on space
characters? Maybe something like this:
$.each(foo.className.split(' '), ...);
Thanks Erik.
This situation has got me all muddled. Where you wrote string is an
array of elements I thought I was misreading something! I need a good
night's sleep or ten and a clear mind :)
Thanks again
On Jul 27, 4:49 pm, Erik Beeson [EMAIL PROTECTED] wrote:
each iterates over the
PD,
I'm trying to iterate through a DOM object's class values to develop
a form validation routine. At the moment the $.each() function is
treating each and every character in the class value as a separate
item, instead of splitting the values into separate values based on
spaces. Therefore this
3 matches
Mail list logo