在IE下错误,修改bug:
function getElementsByClassName(className, parentElement){
var elems = ($(parentElement)||document.body).getElementsByTagName("*");
var result=[];
var i,j;
for (i=0; j=elems[i]; i++){
if ((" "+j.className+" ").indexOf(" "+className+" ")!=-1){
result.push(j);
}
}
return result;
}
转至:http://hi.baidu.com/sansna/blog/item/b3934254b4eeb65d574e0033.html