[jQuery] Re: Iteration through multiple class attribute values

2007-07-27 Thread Erik Beeson
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(' '), ...);

[jQuery] Re: Iteration through multiple class attribute values

2007-07-27 Thread pd
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

[jQuery] Re: Iteration through multiple class attribute values

2007-07-27 Thread Dan G. Switzer, II
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