<div class="a" >hello world</div>
        <script>
            //通过JS来覆写对象的样式是典型的一种销毁原样式并重建的过程,这种销毁和重建,都会增加浏览器的开销
            var elem = document.getElementById("a");
            elem.style.cssText += " ;color:red; font-weight:700;"
            alert(elem.style.cssText)
        </script>

  

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2021-07-11
  • 2021-09-23
  • 2022-02-06
  • 2021-08-05
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
  • 2021-05-24
  • 2021-12-24
  • 2021-07-01
相关资源
相似解决方案