function removeClassName(el, cls) {
  if (!cls || !(cls = cls.trim())) {
    return;
  }

  var clsArr = cls.split(/\s+/);
  if (el.classList) {
    clsArr.forEach(function (c) {
      return el.classList.remove(c);
    });
  } else {
    var curCls = ' ' + el.className + ' ';
    clsArr.forEach(function (c) {
      var tar = ' ' + c + ' ';
      while (curCls.indexOf(tar) !== -1) {
        curCls = curCls.replace(tar, ' ');
      }
    });
    el.className = curCls.trim();
  }
}
function removeClassName(el, cls) {
  if (!cls || !(cls = cls.trim())) {
    return;
  }

  var clsArr = cls.split(/\s+/);
  if (el.classList) {
    clsArr.forEach(function (c) {
      return el.classList.remove(c);
    });
  } else {
    var curCls = ' ' + el.className + ' ';
    clsArr.forEach(function (c) {
      var tar = ' ' + c + ' ';
      while (curCls.indexOf(tar) !== -1) {
        curCls = curCls.replace(tar, ' ');
      }
    });
    el.className = curCls.trim();
  }
}
function removeClassName ( el , cls ) { if ( ! cls || ! ( cls = cls . trim ( ) ) ) { return ; } var clsArr = cls . split ( / \s+ / ) ; if ( el . classList ) { clsArr . forEach ( function ( c ) { return el . classList . remove ( c ) ; } ) ; } else { var curCls = ' ' + el . className + ' ' ; clsArr . forEach ( function ( c ) { var tar = ' ' + c + ' ' ; while ( curCls . indexOf ( tar ) !== - 1 ) { curCls = curCls . replace ( tar , ' ' ) ; } } ) ; el . className = curCls . trim ( ) ; } }
为HTML元素移除className
@param {HTMLElement} el 目标元素
@param {String} cls 要移除的className（多个以空格分割）
为HTML元素移除className