function workshow(div) //打开层 { document.getElementById(div).style.display='block'; } function workclose(div) //隐藏层 { document.getElementById(div).style.display='none'; } function trainshow(box,showid,closediv) //得到选择值 { var ss=""; var tt, n=0; var nn =document.all.item(box);
for (j=0; j<nn.length; j++) { if (document.all.item(box,j).checked) { //复选框被选中 n = n + 1; tt =document.all.item(box,j).value+""; //选中复选框的值 if(n==1) { ss= tt; } else { ss=ss + "<br>"+ tt; } } } document.getElementById(showid).innerHTML=ss; //所选内容显示在ID为showid单元格 document.getElementById(closediv).style.display='none'; //隐藏选择层 }
http://blog.csdn.net/lihan6415151528/archive/2008/10/29/3175958.aspx
估计改动下,能满足你的需求!
{
document.getElementById(div).style.display='block';
}
function workclose(div) //隐藏层
{
document.getElementById(div).style.display='none';
}
function trainshow(box,showid,closediv) //得到选择值
{
var ss="";
var tt, n=0;
var nn =document.all.item(box);
for (j=0; j<nn.length; j++) {
if (document.all.item(box,j).checked) { //复选框被选中
n = n + 1;
tt =document.all.item(box,j).value+""; //选中复选框的值
if(n==1) {
ss= tt;
}
else {
ss=ss + "<br>"+ tt;
}
}
}
document.getElementById(showid).innerHTML=ss; //所选内容显示在ID为showid单元格
document.getElementById(closediv).style.display='none'; //隐藏选择层
}