[jQuery] Iteration through multiple class attribute values
Hi All
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 doesn't really work:
var fieldClasses = parsedInField.className;
or
var fieldClasses = $(parsedInField).attr('class');
$.each( fieldClasses ,
function (count, clarse) {
if (clarse == 'alphanum') {
// blah
} else if (clarse == 'numeric') {
// blah
}
}
);
Can anyone confirm if this should work? If so am I missing something?
It is later on Friday afternoon down here in Australia :) Not the
best of time for concentrating.
Example (not so clean, sorry) is here:
http://devel.webutils.vicnet.net.au/
Any help would be immensely appreciated.
Thanks
pd