<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>测试程序
<option>tullia
</select>
运行的时候看上去似乎是不可以输入的,但是其实是可以的,直接输入试试看:)
转自51js
