模仿asp.net的checkboxList控件

goldlive_8888 2009-06-09 11:02:09
<script type="text/javascript">
function rowIn(obj){
obj.style.backgroundColor="#316AC5";
obj.style.color="#FFFFFF";
}
function rowOut(obj){
obj.style.backgroundColor="#FFFFFF";
obj.style.color="#000000";
}
function rowCheck(obj){
obj.firstChild.firstChild.checked=!obj.firstChild.firstChild.checked;
}
</script>
<select multiple>
<option>1</option>
<option>2</option>
</select>
<div style="width:200px;height:200px;border:1px solid #7F9DB9">
<div style="margin:1px;width:195px;height:195px;overflow:auto;border-top:1px solid #716F64;border-left:1px solid #716F64;border-right:1px solid #F1EFE2;border-bottom:1px solid #F1EFE2">
<table style="width:100%">
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="1">计划A</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="2">计划B</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="3">计划C</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="4">计划D</td>
</tr>
</table>
</div>
</div>
希望能帮助从事java Web开发兄弟姐妹们!
...全文
55 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
goldlive_8888 2009-06-16
  • 打赏
  • 举报
回复
<script type="text/javascript">
function rowIn(obj){
obj.style.backgroundColor="#316AC5";
obj.style.color="#FFFFFF";
}
function rowOut(obj){
obj.style.backgroundColor="#FFFFFF";
obj.style.color="#000000";
}
function rowCheck(obj){
obj.firstChild.firstChild.checked=!obj.firstChild.firstChild.checked;
}
</script>
<select multiple>
<option>1</option>
<option>2</option>
</select>
<div style="width:200px;height:200px;border:1px solid #7F9DB9">
<div style="margin:1px;width:195px;height:195px;overflow:auto;border-top:1px solid #716F64;border-left:1px solid #716F64;border-right:1px solid #F1EFE2;border-bottom:1px solid #F1EFE2">
<table style="width:100%">
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="1" onclick="this.checked=!this.checked">计划A</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="2" onclick="this.checked=!this.checked">计划B</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="3" onclick="this.checked=!this.checked">计划C</td>
</tr>
<tr onmouseover="rowIn(this)" onmouseout="rowOut(this)" onclick="rowCheck(this)">
<td><input type="checkbox" value="4" onclick="this.checked=!this.checked">计划D</td>
</tr>
</table>
</div>
</div>
浪尖赏花 2009-06-09
  • 打赏
  • 举报
回复
支持一哈

87,904

社区成员

发帖
与我相关
我的任务
社区描述
Web 开发 JavaScript
社区管理员
  • JavaScript
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧