原生js修改属性的六种方法
转载:JS 修改元素属性的六种方式_boonyaxnn的博客-CSDN博客_js设置元素属性方式一、1.setAttribute 描述:设置元素的【属性】 语法:元素名.setAttribute('属性','属性值'); 例子: box.setAttribute('style','background-color:red;height:400px'); 注意:设置的是行内样式2.getAttribute 描述:获取属...https://blog.csdn.net/boonyaxnn/article/d
复制链接