function getElementsByClass(searchClass,node,tag) { //Dustin Diaz's getElementsByClass implementation
var classElements = new Array();
if ( node == null )
node = document;
if ( tag == null )
tag = '*';
var els = node.getElementsByTagName(tag);
var elsLen = els.length;
var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
for (i = 0, j = 0; i < elsLen; i++) {
if ( pattern.test(els[i].className) ) {
classElements[j] = els[i];
j++;
} //if
} //for
return classElements;
}
if(document.getElementsByClassName) {
//Firefox 3 C++ native implementation
var classes_ = document.getElementsByClassName("someClass");
} else {
//Dustin Diaz's getElementsByClass implementation (written above)
var classes_ = getElementsByClass("someClass", document, "someTAG");
}
таким кодом пользуюсь в своей работе.