classList
dom.classList.contains('black')
// 删除 black
dom.classList.remove('black')
// 新增.red
dom.classList.add('red')
className
let cName = elementNodeReference.className;
elementNodeReference.className = cName;
详情见官网 https://developer.mozilla.org/
标签:dom,classList,js,className,cName,black From: https://www.cnblogs.com/sqmw/p/17289108.html