lib/index.esm.js
function setAttr(el, attrName, attrVal) {
  if (attrVal === undefined) {
    el.removeAttribute(attrName);
  } else {
    el.setAttribute(attrName, attrVal);
  }
}
function setAttr(el, attrName, attrVal) {
  if (attrVal === undefined) {
    el.removeAttribute(attrName);
  } else {
    el.setAttribute(attrName, attrVal);
  }
}
function setAttr ( el , attrName , attrVal ) { if ( attrVal === undefined ) { el . removeAttribute ( attrName ) ; } else { el . setAttribute ( attrName , attrVal ) ; } }
设置HTML元素属性值
@param {HTMLElement} el 目标元素
@param {String} attrName 目标属性名称
@param {String} attrVal 目标属性值
设置HTML元素属性值