1 回答

TA貢獻(xiàn)1812條經(jīng)驗(yàn) 獲得超5個(gè)贊
<style type="text/css">
.red
{
background-color:red;
}
</style>
<script language="javascript" type="text/javascript">
window.onload=function()
{
var trList = document.getElementById("repeater");
for(var i=0;i<trList.rows.length;i++)
{
trList.rows[i].onclick=SetColor;
}
}
function SetColor()
{
var trList = document.getElementById("repeater");
for(var i=0;i<trList.rows.length;i++)
{
trList.rows[i].className="";
}
this.className="red";
}
</script>
repeater 是你Repeater表格的id
- 1 回答
- 0 關(guān)注
- 570 瀏覽
添加回答
舉報(bào)