<script> <br>function clearOption(obj,e){ <br>var currKey=0,e=e||event; <br>currKey=e.keyCode||e.which||e.charCode; <br>if(currKey == 8){ <br>obj. options[0].text = ""; <br>} <br>} <br>function writeSelect(obj,e){ <br>var currKey=0,e=e||event; <br>currKey=e .keyCode||e.which||e.charCode; <br>obj.options[0].selected = "select"; <br>if(currKey != 8){//This place is to avoid firefox again If annoying garbled characters appear, you can try commenting this sentence to see the effect in firefox <br>obj.options[0].text = obj.options[0].text String.fromCharCode(currKey); <br>} <br>e.returnValue=false; <br>return obj.options[0].text; <br>} <br>function ttt(){ <br>var jg = document.getElementById("aa") .options[document.getElementById("aa").selectedIndex].text; <br>//Of course, you can also set the value of options in the previous writeSelect function. In this case, you can directly use value to get it out in the program<br>jQuery("#aa").empty(); <br>jQuery("#aa").append("<option value=''></option>"); <br>} <br><br></script>
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn