js兼容方法:通过样式名获取元素,byClass

function byClass(oParent,className){
  if(document.getElementsByClassName){ //if it is Firefox
    return oParent.getElementsByClassName(className);
  }else{
    var tags = oParent.getElementsByTagName("*");
    var tagsLength = tags.length;
    var result = [];
    for(var i=0;i<tagsLength;i++){
      if(tags[i].className==className){
        result.push(tags[i]);
      }
    }
    return result;
  }
}
上一篇:HDU 4632 Palindrome subsequence(区间dp,回文串,字符处理)


下一篇:php调去存储过程