JavaScript attribute 属性操作
小于 1 分钟约 43 字
JavaScript attribute 属性操作
div.getAttribute('className'); // 获取属性
div.setAttribute('class', 'ft'); // 设置属性
div.removeAttribute('class'); // 删除属性
div.attributes; // 获取 div 所有的属性 返回集合
div.getAttribute('className'); // 获取属性
div.setAttribute('class', 'ft'); // 设置属性
div.removeAttribute('class'); // 删除属性
div.attributes; // 获取 div 所有的属性 返回集合