使得select選擇框也可以輸入

  1. <script language="javascript">  
  2.     function changeF()   
  3.     {   
  4.        document.getElementById('makeupCo').value=   
  5.        document.getElementById('makeupCoSe').options[document.getElementById('makeupCoSe').selectedIndex].value;   
  6.     }   
  7. </script>  
  8.   
  9. <span style="position:absolute;border:1pt solid #c1c1c1;overflow:hidden;width:188px;   
  10.     height:19px;clip:rect(-1px 190px 190px 170px);">  
  11. <select name="makeupCoSe" id="makeupCoSe" style="width:190px;height:20px;margin:-2px;" onChange="changeF();">  
  12.     <option id='1' value='java'>java</option>  
  13.     <option id='2' value='c++'>c++</option>  
  14.     <option id='3' value='python'>python</option>  
  15.     <OPTION id="99999" VALUE="" SELECTED>  
  16. </select>  
  17. </span>  
  18. <span style="position:absolute;border-top:1pt solid #c1c1c1;border-left:1pt    
  19.     solid #c1c1c1;border-bottom:1pt solid #c1c1c1;width:170px;height:19px;">  
  20.     <input type="text" name="makeupCo" id="makeupCo" value="請選擇或輸入" style="width:170px;height:15px;border:0pt;">  
  21. </span>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章