HTML Code:
![ContractedBlock.gif](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![ExpandedBlockStart.gif](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
< head runat ="server" >
< title > 无标题页 </ title >
< script type ="text/javascript" >
var checkItem = function (index)
{
if (index == 1 )
{
$( " #chkCRREQ :checkbox " ).each( function (){$( this ).attr( " checked " , true );});
}
else
{
$( " #chkCRREQ :checkbox " ).each( function (){$( this ).attr( " checked " , false );});
}
}
</ script >
</ head >
< body >
< form id ="form1" runat ="server" >
< div >
< table style ="width:100%;" border ="1" >
< tr >
< td colspan ="3" align ="center" style ="font-size:larger;" > CRREQ </ td >
</ tr >
< tr >
< td colspan ="3" >
< input id ="btnSelect" type ="button" onclick ="checkItem(1)" value ="select all" />
< input id ="btndeselect" type ="button" onclick ="checkItem(2)" value ="deselect all" />
</ td >
</ tr >
< tr >
< td >
< asp:CheckBoxList ID ="chkCRREQ" runat ="server" RepeatColumns ="3" RepeatDirection ="Horizontal" Width ="100%" >
</ asp:CheckBoxList >
</ td >
</ tr >
</ table >
</ div >
</ form >
</ body >
</ html >
< head runat ="server" >
< title > 无标题页 </ title >
< script type ="text/javascript" >
var checkItem = function (index)
{
if (index == 1 )
{
$( " #chkCRREQ :checkbox " ).each( function (){$( this ).attr( " checked " , true );});
}
else
{
$( " #chkCRREQ :checkbox " ).each( function (){$( this ).attr( " checked " , false );});
}
}
</ script >
</ head >
< body >
< form id ="form1" runat ="server" >
< div >
< table style ="width:100%;" border ="1" >
< tr >
< td colspan ="3" align ="center" style ="font-size:larger;" > CRREQ </ td >
</ tr >
< tr >
< td colspan ="3" >
< input id ="btnSelect" type ="button" onclick ="checkItem(1)" value ="select all" />
< input id ="btndeselect" type ="button" onclick ="checkItem(2)" value ="deselect all" />
</ td >
</ tr >
< tr >
< td >
< asp:CheckBoxList ID ="chkCRREQ" runat ="server" RepeatColumns ="3" RepeatDirection ="Horizontal" Width ="100%" >
</ asp:CheckBoxList >
</ td >
</ tr >
</ table >
</ div >
</ form >
</ body >
</ html >