document.getElementById('XXX').stlyle.color = 'red';
看你是什么html得element,如果是table,在那个td上加个id,
然后做document.getElementById('XXX').innerHTML = '<span color="red">XXX</span>';
看你是什么html得element,如果是table,在那个td上加个id,
然后做document.getElementById('XXX').innerHTML = '<span color="red">XXX</span>';
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=GBK">
<title></title>
<script language=javascript>
window.onload=function(){
var o=document.getElementsByTagName("td");
for(var i=0;i<o.length;i++){
var e=o[i].style.color="red";
}
}
</script>
</head>
<body>
<table border=1>
<tr><td>ab</td><td>cd</td>
</tr>
<tr><td>ef</td><td>gh</td>
</tr>
</table>
</body>
</html>