<SCRIPT LANGUAGE="JavaScript"> <!-- Begin function catch_keydown(sel) { switch(event.keyCode) { case 13: //Enter; sel.options[sel.length] = new Option("","",false,true); event.returnValue = false; break; case 27: //Esc; alert("text:" + sel.options[sel.selectedIndex].text + ", value:" + sel.options[sel.selectedIndex].value + ";"); event.returnValue = false; break; case 8: //Back Space; var s = sel.options[sel.selectedIndex].text; sel.options[sel.selectedIndex].text = s.substr(0,s.length-1); event.returnValue = false; break; } } function catch_press(sel) { sel.options[sel.selectedIndex].text = sel.options[sel.selectedIndex].text + String.fromCharCode(event.keyCode); sel.options[sel.selectedIndex].value = sel.options[sel.selectedIndex].value + String.fromCharCode(event.keyCode);

event.returnValue = false; } //End --> </script>

</head> <center> <select name="fh_cp" onKeyDown="catch_keydown(this);" onKeyPress="catch_press(this);" style="width:200px;"> <option></option> <option value="1">倒萨快递费</option> <option value="2">速度空间开始打飞机</option> </select> </center> </body> </html>

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-25
  • 2022-01-27
  • 2022-12-23
  • 2021-12-18
猜你喜欢
  • 2021-05-18
  • 2021-12-29
  • 2021-11-20
  • 2022-12-23
  • 2021-08-24
  • 2021-05-19
相关资源
相似解决方案