请教:关于 row.setAttribute() 问题

Quen 2007-12-19 04:35:56
var row = document.createElement("tr");
row.setAttribute("bgcolor","#FFFFCC"); //不可以
row.setAttribute("height","28"); //这个可以.
为什么设置背景颜色不行而设置行高可以呢??
...全文
97 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
Quen 2007-12-19
  • 打赏
  • 举报
回复
结贴了..呵呵 谢谢大家关注

用row.style.background = "#abcdef";就可以了. 想复杂了.

谢谢大家!
Quen 2007-12-19
  • 打赏
  • 举报
回复
可以了..呵呵

row.style.background = "#abcdef";

原来这么简单,呵呵 想复杂了...
cloudgamer 2007-12-19
  • 打赏
  • 举报
回复
bgColor Property Internet Development Index

--------------------------------------------------------------------------------

Deprecated. Sets or retrieves a value that indicates the background color behind the object.

Syntax

document.bgColor [ = sColor ]


bgcolor改成bgColor看看
gimse7en 2007-12-19
  • 打赏
  • 举报
回复
关注。。。
Quen 2007-12-19
  • 打赏
  • 举报
回复
那为什么设置行高又可以哦

还有row.setAttribute("style","backgroundColor:#CCCCCC");
也不行呢.
cloudgamer 2007-12-19
  • 打赏
  • 举报
回复
用style.backgroundColor
setAttribute貌似ie不支持

52,797

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 Ajax
社区管理员
  • Ajax
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧