不多說,直接上代碼:
<html> <head> <title>可輸入的select下拉框</title> </head> <body > <div style="position:relative; padding: 0px;margin: 0px;"> <input name="salesCode" id="salesCode" style="position:absolute;top:-10; width: 120px; height:21px; left:0px; " onClick="this.value=''"> <span id="selectInput"> <select name="selectInput" style="position:absolute;top:-10;width:120px;height:20px;left:0px; clip: rect(0 180 132 101)" onchange="document.getElementById('salesCode').value=options[selectedIndex].text;"> <option value=""></option> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> </select> </span> </div> </body> </html>