<input type="checkbox" name="qId" onclick="doit();"/>
<input type="checkbox" name="qId" onclick="doit();"/>
<input type="checkbox" name="qId" onclick="doit();"/>
<input type="checkbox" name="qId" onclick="doit();"/>
<div id="number" style="padding:10px">已选0道多选题</div>
<script type="text/javascript">
function doit()
{
var n=0;
var objs = document.getElementsByName("qId");
for(var i=0; i<objs.length; i++)
{
if(objs[i].checked)
{
n++;
}
}
document.getElementById("number").innerText="已选"+n+"道多选题";
}
</script>