JS 动态添加Table 列样式没有效果 在线等
<%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
   <head>	
	<script type="text/javascript">
		function insert(){
			var table = document.getElementById('tab');
			var tbody  = table.firstChild;
			var temp = tbody.lastChild;
			var tb = document.createElement('td');
			tb.setAttribute('className','123');
			tb.setAttribute('bgcolor','#1233');
			tb.innerHTML = '456';
			temp.appendChild(tb);
		}
	</script>
   </head>    
   <body>
     <table id='tab' border=1 bordercolor=#000000>
     	<tr >
     		<td bgcolor='#4444'>123</td><td>456</td><td>789</td>
     	</tr>
     	<tr>
     		<td>123</td>
     	</tr>
     </table>
     <input type='button' onClick="insert()" value='test'>
   </body>
</html>
指定添加的td 背景颜色 并没有变化
------解决方案--------------------
 tb.setAttribute('bgColor', 'red');
c大写
------解决方案--------------------