Am afraid its quite late (early?) and I haven't had time to check it
but you could try something like this?
function checkClassName(el, regEx) {
el = (typeof el == "string") ? $(el) : el;
return el.className.match(new RegExp(regEx));
}
var elements = [ "myElement1", "myElement2", "myElement3", "myElement4"
];
for (var i = elements.length-1; i >= 0; --i){
if(checkClassName(elements[i], "##RegEx##")) {
// Do stuff
} else {
// do other stuff
}
}
On Jan 19, 2:50 am, Daniel Eben Elmore <[EMAIL PROTECTED]> wrote:
Is there a function like getElementsByClassName where I can use regex to
match the class names? I want to match class names starting with ...
-Daniel
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby on
Rails: Spinoffs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-spinoffs?hl=en
-~----------~----~----~----~------~----~------~--~---