The example in this article describes how to implement a practical method of clicking the input box to pop up the selection box using JS CSS. Share it with everyone for your reference. The specific implementation method is as follows: Copy code The code is as follows: JS CSS打造实用的单击输入框弹出选择框效果 <br> .black_overlay{display:none;position:absolute;top:0%;left:0%;width:100%;height:100%;background-color:#FFFFFF;z-index:1001;-moz-opacity:0.8;opacity:.80;filter:alpha(opacity=80);}<br> .white_content{display:none;position:absolute;top:25%;left:25%;width:50%;height:50%;padding:16px;border:16px solid orange;margin:-32px;background-color:white;z-index:1002;overflow:auto;}<br> <br> function moveselect(obj,target,all){<br> if (!all) all=0<br> if (obj!="[object]") obj=eval("document.all." obj)<br> target=eval("document.all." target)<br> if (all==0)<br> {<br> while (obj.selectedIndex>-1){<br> //alert(obj.selectedIndex)<br> mot=obj.options[obj.selectedIndex].text<br> mov=obj.options[obj.selectedIndex].value<br> obj.remove(obj.selectedIndex)<br> var newoption=document.createElement("OPTION");<br> newoption.text=mot<br> newoption.value=mov<br> target.add(newoption)<br> }<br> }<br> else<br> {<br> //alert(obj.options.length)<br> for (i=0;i<obj.length;i )<br /> {<br /> mot=obj.options[i].text<br /> mov=obj.options[i].value<br /> var newoption=document.createElement("OPTION");<br /> newoption.text=mot<br /> newoption.value=mov<br /> target.add(newoption)<br /> }<br /> obj.options.length=0<br /> }<br /> }<br /> function dakai(){<br /> document.getElementById('light').style.display='block';<br /> document.getElementById('fade').style.display='block'<br /> }<br /> function guanbi(){<br /> //把右边select的值传到文本框内<br /> var yuanGong=document.getElementById("yuanGong")<br /> yuanGong.value=""//如果不加这句,则每次选择的结果追加<br /> var huoQu=document.getElementById("D2")<br /> for(var k=0;k<huoQu.length;k )<br /> yuanGong.value=yuanGong.value huoQu.options[k].value " "//" "中间为空格,字符分隔符,可以改成别的<br /> document.getElementById('light').style.display='none';<br /> document.getElementById('fade').style.display='none'<br /> }<br /> 本部门员工 张三 李四 小王 等待划分部门的员工 EmployeeX Employee Y OK