使用js设置element的属性

  • Post author:
  • Post category:其他


对于html 元素的属性使用setAttribute

如果要设置样式属性,需要这样写:

    set.setAttribute("style","height :" + hei + "px");
而不能这样写:
 set.setAttribute("height"hei + "px");



版权声明:本文为whatisthatfish原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。