1、使用obj.setAttribute("style"."")方法;

obj.setAttribute("style","-webkit-clip-path: polygon(0% 0%, 66% 0, 33% 100%, 0% 100%);float:none;");
obj.setAttribute("style","position:absolute;background-image:url(1.jpg);");

如果在一个js代码中,同时对一个obj对象使用setAttribute方法设置style,后一个设置会覆盖前面一个的设置。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-19
  • 2022-01-15
  • 2021-06-22
  • 2021-09-27
  • 2022-12-23
猜你喜欢
  • 2021-10-25
  • 2021-10-21
  • 2021-04-03
  • 2022-02-15
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案