function func1(){
alert("123");
//document.getElementById("cc").className="sty1" ;
aa.rows[0].cells[0].style.backgroundColor='#F00';
//document.getElementById("bb").style.backgroundColor='#F00';
alert(aa.rows[0].cells[0].innerHTML);
}<table border="1" width="80%" id="aa">
<tr id="cc" class=""><td id="bb" class="">123</td><td>123</td></tr>
<tr><td>123</td><td>123</td></tr>
<tr><td>123</td><td>123</td></tr>
</table>
alert("123");
//document.getElementById("cc").className="sty1" ;
aa.rows[0].cells[0].style.backgroundColor='#F00';
//document.getElementById("bb").style.backgroundColor='#F00';
alert(aa.rows[0].cells[0].innerHTML);
}<table border="1" width="80%" id="aa">
<tr id="cc" class=""><td id="bb" class="">123</td><td>123</td></tr>
<tr><td>123</td><td>123</td></tr>
<tr><td>123</td><td>123</td></tr>
</table>
解决方案 »
- 留言板的代码在其他浏览器都好用,在ie下就不行?
- 关于筛选json并生成新的json的问题。
- 视频地址解析
- 如何从session取得目标画面id自动迁移(请看看我的source有什么不对?)
- getElementById 能取几个select的length吗
- 请问如何使用javascript脚本得到客户端IP或者本机IP(在线等)
- javascript简单问题~~
- 正则表达式-“匹配大括号里面的内容”怎么写?
- 兩個Date,相差几天,是什么函数啊?
- 提交表单之前,这样限制文本框textfield里的内容只能为数字、英文和汉字
- 如何得到iframe的URL(同一網站下)
- 帮忙看看这段代码,急!!!
<tr id="cc" class=""><td id="bb" class="">123</td><td>123</td></tr>
<tr><td>123</td><td>123</td></tr>
<tr><td>123</td><td>123</td></tr>
</table>
<input type="button" name="asc" id="asc" value="1" onclick="func1()">function func1(){aa.rows[0].cells[0].style.backgroundColor='#F00';
//document.getElementById("bb").style.backgroundColor='#F00';
alert(aa.rows[0].cells[0].innerHTML);
}