JavaScript attribute 属性操作
小于 1 分钟约 43 字
JavaScript attribute 属性操作
div.getAttribute('className'); // 获取属性
div.setAttribute('class', 'ft'); // 设置属性
div.removeAttribute('class'); // 删除属性
div.attributes; // 获取 div 所有的属性 返回集合
版权属于:h7ml
作品采用: 《 署名-非商业性使用-相同方式共享 4.0 国际 (CC BY-NC-SA 4.0) 》许可协议授权