function checkIsthree()
{
var select = document.getElementById("limitedSelect");
o = select.getElementsByTagName("INPUT")
//alert(o.length);
var val=0; for(i=0;i 3)
{ alert('此题最多只能选3个!')
o[i].checked=false; return;
}
}
}
limitedSelect CheckBoxList 的ID
本文介绍了一个简单的JavaScript函数,用于限制用户在一个CheckBoxList中最多只能选择三个选项。当选择超过三个时,会弹出警告并取消多余的选中状态。
1285

被折叠的 条评论
为什么被折叠?



