当前位置: 移动技术网 > IT编程>开发语言>其他编程 > 如何实现在下拉菜单里输入文字?

如何实现在下拉菜单里输入文字?

2017年12月08日  | 移动技术网IT编程  | 我要评论
如何实现在下拉菜单里输入文字?<script>function pp(){se.options[2]

如何实现在下拉菜单里输入文字?

<script>
function pp(){
se.options[2]=new option(ok=(se.options[2])?se.options[2].innertext+string.fromcharcode
(event.keycode):string.fromcharcode(event.keycode),"client")
se.selectedindex=2;
}

function edit(){
if(se.options[2]){
if(event.keycode==8){
var str=se.options[2].innertext;
var len=str.length;
se.options[2].innertext=str.substring(0,len-1);
if(se.options[2].innertext=="")se.remove(2);
}
if(event.keycode==13)return false;
if(event.keycode==32){
se.options[2].innertext+=" ";
}
}
}
</script>
<select id=se onkeypress=pp() onkeyup="edit()">
<option>
山水盈盈之输入文字
</select>

如您对本文有疑问或者有任何想说的,请点击进行留言回复,万千网友为您解惑!

相关文章:

验证码:
移动技术网