无为清净楼资源网 Design By www.qnjia.com
复制代码 代码如下:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head>
<body>

<script language="JavaScript">
<!--
function checkselect(objname){
o = document.getElementById(objname);
t = document.getElementById("output");
var count=0;
var intvalue="";
for(i=0;i<o.length;i++){
if(o.options[i].selected){
intvalue+=o.options[i].value+",";
count++;
}
}
t.value=intvalue.substr(0,intvalue.length-1);
alert(count);

}
//-->
</script>
<select name="objsel" size=8 multiple>
<option value="0" selected>请选择
<option value="1">测试一
<option value="2">测试二
<option value="3">测试三
<option value="4">测试四
<option value="5">测试五
</select>
<input type="button" onclick="checkselect('objsel');" value="输出">
选中的项目:<input type="text" name="output">
</body>
</html>
标签:
JS,select,多选下拉

无为清净楼资源网 Design By www.qnjia.com
广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站文章均来自网站采集或用户投稿,网站不提供任何软件下载或自行开发的软件! 如有用户或公司发现本站内容信息存在侵权行为,请邮件告知! 858582#qq.com
无为清净楼资源网 Design By www.qnjia.com