java脚本,用于警告所选的mutile选项..in <select>
HTMl标记。和标签。不在<form>
标签主体里面怎么做....
谢谢
答案 0 :(得分:1)
var elem = document.getElementById("sel1").getElementsByTagName("option");
var len = elem.length;
var sel = new Array();
for(i=0; i<len;i++)
{
if(elem[i].selected == true)
{
sel.push(elem[i].value);
}
}
alert(sel.join());
<强> Working demo 强>