The drop-down list box cannot be edited by default. The following describes a good way to edit the drop-down list box. The specific implementation is as follows. For more information, see
The Code is as follows:
Script
Function clearOption (obj, e ){
Var currKey = 0, e = e | event;
CurrKey = e. keyCode | e. which | e. charCode;
If (currKey = 8 ){
Obj. options [0]. text = "";
}
}
Function writeSelect (obj, e ){
Var currKey = 0, e = e | event;
CurrKey = e. keyCode | e. which | e. charCode;
Obj. options [0]. selected = "select ";
If (currKey! = 8) {// This part is intended to avoid annoying Garbled text in firefox. You can try to comment this sentence to see the effect in firefox.
Obj. options [0]. text = obj. options [0]. text + String. fromCharCode (currKey );
}
E. returnValue = false;
Return obj. options [0]. text;
}
Function ttt (){
Var jg = document. getElementById ("aa"). options [document. getElementById ("aa"). selectedIndex]. text;
// Of course, you can also set the options value in the previous writeSelect function. In this way, you can use the value in the program to retrieve the value.
JQuery ("# aa"). empty ();
JQuery ("# aa"). append ("");
}
Script
The Code is as follows:
11 22 33