最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

select多選 multiple的使用示例

 更新時間:2014年06月16日 15:52:31   投稿:whsnow  
使用multiple可以實現(xiàn)select多選,本例將為大家介紹下select多選 multiple的使用,新手朋友們可以學習下
復制代碼 代碼如下:

<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 id="selectOption" style='width:100px;height:50px;z-index:100;border:1px solid #0099FF;background:#cccccc;display:none;'>
<select id="mySelect" multiple="multiple" size="4">
<option value='蘋果'>蘋果</option>
<option value='桃子'>桃子</option>
<option value='香蕉'>香蕉</option>
<option value='桔子'>桔子</option>
</select>
<input type="button" onclick="checkselect('mySelect')" value="checkselect">
</div>
選中的項目:<input type="text" name="output">
<input id="lalla" type="button" onclick="showDiv(this.id)" value="選擇">
<br/>
</form>
<p>在您點擊 “選擇多個” 按鈕之前,請嘗試同時選取多個選項。在點擊 “選擇多個” 按鈕之后,請再試一次。</p>
</form>
</body>
</html>

相關文章

最新評論

敖汉旗| 长汀县| 石台县| 凤翔县| 文水县| 厦门市| 双流县| 抚宁县| 滦南县| 通州区| 阿瓦提县| 彭水| 新巴尔虎左旗| 商都县| 宁陵县| 黎城县| 贞丰县| 资中县| 崇文区| 沙雅县| 邯郸市| 遂溪县| 招远市| 扬中市| 桃园县| 华池县| 郯城县| 临海市| 睢宁县| 阿拉善右旗| 咸宁市| 柳州市| 丘北县| 丰原市| 赣州市| 繁峙县| 三台县| 安国市| 桓台县| 长乐市| 福鼎市|