模仿asp.net的checkboxList控件
<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开发兄弟姐妹们!
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开发兄弟姐妹们!
...全文
相关推荐
asp.net Dropdownlist结合CheckBoxList多选下拉框
在ASP.NET开发中,Dropdownlist控件通常用于创建单选下拉列表,而CheckBoxList控件则用于展示可多选的列表项。
ASP.NET中CheckBoxList复选框列表控件详细使用方法
在***开发中,CheckBoxList控件是一个非常实用的组件,它允许我们通过列表形式展示一组复选框,并且可以很方便地对这些复选框进行操作。
Asp.net CheckBoxList操作集合
通过查看和学习这些文件,你可以更深入地理解ASP.NET中CheckBoxList控件的使用和操作。以上就是关于ASP.NET中CheckBoxList控件的选中项操作、全选、取消选中以及反选的方法。
asp.net Javascript获取CheckBoxList的value
在ASP.NET开发中,有时我们需要在客户端JavaScript中操作CheckboxList控件,但可能会遇到一个问题:无法通过JavaScript直接获取选中的值(value)。这通常发生在服务器
ASP.NET中用js取CheckBoxList中值的方法实例
`<asp:CheckBoxList ID="cblKeyWords" runat="server" RepeatColumns="2">`是ASP.NET中的CheckBoxList控件,它在客户端呈现为一组


