<input type="checkbox" name="qId" onclick="doit();"/><input type="checkbox" name="qId" onclick="doit();"/><input type="checkbox" name="qId" onclick="d ...
<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>