<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>select 多选</title>
<script language="javascript">
<!--
function show(){
var sel = document.forms["form1"].s1;
var s = "";
for(var i=0;i<sel.options.length;i++){
if(sel.options[i].selected)
s += sel.options[i].innerText + ",";
}
if(s!="") s = s.substr(0,s.length-1);
alert(s);
}
-->
</script>
</head>
<body>
<form name="form1" id="form1">
<div width="300" height="160" border="1">
<select name= "s1" style= "WIDTH: 100px " multiple="multiple" size=15 id="list" >
<option>XHTML</option>
<option>CSS</option>
<option>JAVASCRIPT</option>
<option>XML</option>
<option>PHP</option>
<option>C#</option>
<option>JAVASCRIPT</option>
<option>XML</option>
<option>PHP</option>
<option>C#</option>
<option>JAVASCRIPT</option>
<option>XML</option>
<option>PHP</option>
<option>C#</option>
<option>JAVASCRIPT</option>
<option>XML</option>
<option>PHP</option>
<option>C#</option>
<option>JAVA</option>
<option>C++</option>
<option>PERL</option>
</select>
</div>
<input name="button" type="button" οnclick="show()" value="ShowOptionText" />
</form>
</body>
</html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>select 多选</title>
<script language="javascript">
<!--
function show(){
var sel = document.forms["form1"].s1;
var s = "";
for(var i=0;i<sel.options.length;i++){
if(sel.options[i].selected)
s += sel.options[i].innerText + ",";
}
if(s!="") s = s.substr(0,s.length-1);
alert(s);
}
-->
</script>
</head>
<body>
<form name="form1" id="form1">
<div width="300" height="160" border="1">
<select name= "s1" style= "WIDTH: 100px " multiple="multiple" size=15 id="list" >
<option>XHTML</option>
<option>CSS</option>
<option>JAVASCRIPT</option>
<option>XML</option>
<option>PHP</option>
<option>C#</option>
<option>JAVASCRIPT</option>
<option>XML</option>
<option>PHP</option>
<option>C#</option>
<option>JAVASCRIPT</option>
<option>XML</option>
<option>PHP</option>
<option>C#</option>
<option>JAVASCRIPT</option>
<option>XML</option>
<option>PHP</option>
<option>C#</option>
<option>JAVA</option>
<option>C++</option>
<option>PERL</option>
</select>
</div>
<input name="button" type="button" οnclick="show()" value="ShowOptionText" />
</form>
</body>
</html>