国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 語言 > JavaScript > 正文

select多選 multiple的使用示例

2024-05-06 16:09:03
字體:
供稿:網(wǎng)友
使用multiple可以實(shí)現(xiàn)select多選,本例將為大家介紹下select多選 multiple的使用,新手朋友們可以學(xué)習(xí)下

復(fù)制代碼 代碼如下:


<html>
<head>
<script type="text/javascript">
function showDiv(id){

document.getElementById("selectOption").style.display="block";
document.getElementById("selectOption").style.position="absolute";
document.getElementById("selectOption").style.top=document.getElementById(id).offsetTop+25;
document.getElementById("selectOption").style.left=document.getElementById(id).offsetLeft+20;
}
function selectM()
{
var obj = document.getElementById("mySelect");
alert(obj.selectedIndex);

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

}

</script>
</head>
<body>

<form>
<div>
<select multiple="multiple" size="4">
<option value='蘋果'>蘋果</option>
<option value='桃子'>桃子</option>
<option value='香蕉'>香蕉</option>
<option value='桔子'>桔子</option>
</select>
<input type="button" value="checkselect">
</div>
選中的項(xiàng)目:<input type="text">
<input type="button" value="選擇">
<br/>
</form>
<p>在您點(diǎn)擊 “選擇多個(gè)” 按鈕之前,請(qǐng)嘗試同時(shí)選取多個(gè)選項(xiàng)。在點(diǎn)擊 “選擇多個(gè)” 按鈕之后,請(qǐng)?jiān)僭囈淮巍?lt;/p>
</form>
</body>
</html>

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表

圖片精選

主站蜘蛛池模板: 澄江县| 侯马市| 北宁市| 自贡市| 琼中| 黄骅市| 稷山县| 遂宁市| 曲松县| 临沭县| 德清县| 日喀则市| 丰宁| 北京市| 平武县| 镇原县| 新建县| 灵山县| 磐石市| 灵武市| 玛纳斯县| 文登市| 英山县| 衡阳市| 黑水县| 柞水县| 绿春县| 格尔木市| 酒泉市| 陆良县| 高清| 灵寿县| 德昌县| 宜都市| 永胜县| 尤溪县| 云南省| 巩留县| 财经| 河西区| 元朗区|