<html>
<head>
<meta http-equiv="Content-Type" content="text/htmlcharset=gb2312" />
<title>无标题文档</title>
</head>
<script language="javascript">
function getValue()
{
var s = ""
for(var i=0i<form1.ss.options.lengthi++)
{
if(form1.ss.options[i].selected)
{
s+=form1.ss.options[i].value
}
}
alert(s)
}
</script>
<body>
<form id="form1" name="form1" method="post" action="">
请选择:
<select id="ss" name="ss" size="5" multiple="multiple">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
</select>
<br>
<input type="button" name="Submit" value="提交" onclick="getValue()" />
</form>
</body>
</html>
**************************补充**********************
修改select标签的size属性,把它的值改为1即可。
加入了multiple可以多个选择了,包括Shift进行快速全选及Ctrl进行点选<form name="form1">
<select name="selectwhat" size=3 multiple>
<option value="a">aaa</option>
<option value="b">bbb</option>
<option value="c">ccc</option>
</select>
</form>
这也行吧 多选
<form action="" method="post">
<input name="name[]" type="checkbox" value="1" />1<br />
<input name="name[]" type="checkbox" value="2" />2<br />
<input name="name[]" type="checkbox" value="3" />3<br />
<input name="name[]" type="checkbox" value="4" />4<br />
<input name="name[]" type="checkbox" value="5" />5
</form>