<div class="codetitle"> <span><a style="CURSOR: pointer" data="7801" class="copybut" id="copybut7801" onclick="doCopy('code7801')"><u>复制代码</u></a></span> 代码如下:</div> <div class="codebody" id="code7801"> <br> <br> <br> <br><title> New Document </title> <br><meta name="Generator" content="EditPlus"> <br><meta name="Author" content=""> <br><meta name="Keywords" content=""> <br><meta name="Description" content=""> <br> <br> <br><br><script language="JavaScript"> <BR><!-- <BR>function checkselect(objname){ <BR>o = document.getElementById(objname); <BR>t = document.getElementById("output"); <BR>var count=0; <BR>var intvalue=""; <BR>for(i=0;i<o.length;i++){ <BR>if(o.options[i].selected){ <BR>intvalue+=o.options[i].value+","; <BR>count++; <BR>} <BR>} <BR>t.value=intvalue.substr(0,intvalue.length-1); <BR>alert(count); <br><br>} <BR>//--> <BR></script> <br><select name="objsel" size="8" multiple> <br><option value="0" selected>请选择 <br> </option> <option value="1">测试一 <br> </option> <option value="2">测试二 <br> </option> <option value="3">测试三 <br> </option> <option value="4">测试四 <br> </option> <option value="5">测试五 <br> </option></select> <br><input type="button" onclick="checkselect('objsel');" value="输出"> <br>选中的项目:<input type="text" name="output"> <br> <br> <br> </div>