首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

请教datalist的变色有关问题

2012-01-13 
请问datalist的变色问题我现在在datalist中放了一个html的tabletable中放了一个web的checkbox请问怎么能够

请问datalist的变色问题
我现在在datalist中放了一个html的table   table中放了一个web的checkbox
请问怎么能够在点击checkbox的时候让所选项的table背景色改变
谢谢

[解决办法]
<table name= 'tb <%# DataBinder.Eval(Container.DataItem, "ID ")%> '>
<tr>
<td>
<input type= "checkbox " onchange= 'javascript:if(this.checked)changeStyle( <%# DataBinder.Eval(Container.DataItem, "ID ")%> ) ' />
</td>
</tr>
</table>
<script language=javascript>
function changeStyle(id)
{
document.getElementById( "tb " + id).style.bgcolor = "#f00 ";
}
</script>

热点排行