87,910
社区成员
发帖
与我相关
我的任务
分享
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<script language="javascript">
function getLength()
{
seletLen=document.getElementById("selectInfo").length
alert(seletLen);
}
</script>
<body>
<div id="outer">
<select name="selectInfo" size="20" style="width:200px;" multiple="multiple" >
<option value="">aaa</option>
<option value="">bbb</option>
<option value="">ccc</option>
</select>
</div>
<input type="button" value="获得" onClick="getLength()">
</body>
</html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<script language="javascript">
function getLength()
{
seletLen=document.getElementById("selectInfo").options.length;
alert(seletLen);
}
</script>
<body>
<div id="outer">
<select id="selectInfo" size="20" style="width:200px;" multiple="multiple" >
<option value="">aaa</option>
<option value="">bbb</option>
<option value="">ccc</option>
</select>
</div>
<input type="button" value="获得" onClick="getLength()">
</body>
</html>
$('select option').length