模仿asp.net的checkboxList控件

goldlive_8888 goldlive_8888 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
<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开发兄弟姐妹们!
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
goldlive_8888
JavaScript 87,984 成员 224,681 内容