本文主要是介绍JS实现下可输入拉选框,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
直接附上代码
<script language="javascript">function changeF(){document.getElementById('makeupCo').value=document.getElementById('makeupCoSe').options[document.getElementById('makeupCoSe').selectedIndex].value;}
</script><span style="position:absolute;border:1pt solid #c1c1c1;overflow:hidden;width:188px;height:19px;clip:rect(-1px 190px 190px 170px);">
<select name="makeupCoSe" id="makeupCoSe" style="width:190px;height:20px;margin:-2px;" onChange="changeF();"><option id='1' value='test1'>test1</option><option id='2' value='test2'>test2</option><option id='3' value='test3'>test3</option>
</select>
</span><span style="position:absolute;border-top:1pt solid #c1c1c1;border-left:1ptsolid #c1c1c1;border-bottom:1pt solid #c1c1c1;width:170px;height:19px;"><input type="text" name="makeupCo" id="makeupCo" value="请选择或输入" style="width:170px;height:15px;border:0pt;">
</span>
这篇关于JS实现下可输入拉选框的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!