本身select标签 是不能输入的,但我们可以通过JS来控制
下面给出一个小例子
<
div style
=
"
position:relative;
"
>
< span style = " margin-left:100px;width:18px;overflow:hidden; " >
< select style = " width:118px;margin-left:-100px; " onchange = " this.parentNode.nextSibling.value=this.options[this.selectedIndex].text; " >
< option value = " -1 " > 请选择... </ option >
< option value = " 1 " > 吾顷仰 </ option >
</ select >
</ span >
< input type = " text " style = " width:100px;position:absolute;left:0px; " value = " 请选择... " >
</ div >
< span style = " margin-left:100px;width:18px;overflow:hidden; " >
< select style = " width:118px;margin-left:-100px; " onchange = " this.parentNode.nextSibling.value=this.options[this.selectedIndex].text; " >
< option value = " -1 " > 请选择... </ option >
< option value = " 1 " > 吾顷仰 </ option >
</ select >
</ span >
< input type = " text " style = " width:100px;position:absolute;left:0px; " value = " 请选择... " >
</ div >