複製代碼 代碼如下:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>可選擇和輸入的下拉式清單方塊</title>
<style type="text/css">
div,span,p,td,font{font-size:9pt;}
</style>
</head>
<body>
<table cellspacing="0" cellpadding="0" width="100%" border="0"><tr><td align="left">
<!--select標籤和input外面的span標籤的格式是為了使兩個位置在同一位置,控制位置-->
<span style="position:absolute;border:1pt solid #c1c1c1;overflow:hidden;width:188px;height:19px;clip:rect(-1px 190px 190px 170px);">
<select name="aabb" id="aabb" style="width:190px;height:20px;margin:-2px;"
onChange="javascript:document.getElementById('ccdd').value=document.getElementById('aabb').options[document.getElementById('aabb').selectedIndex].value;">
<!--下面的option的樣式是為了使字型為灰色,只是視覺問題,看起來像是注釋一樣-->
<option value="" style="color:#c2c2c2;">---請選擇---</option>
<option value="閑人書庫">閑人書庫</option>
<option value="閑人BLOG">閑人BLOG</option>
<option value="閑人設計">閑人設計</option>
<option value="閑人軟體">閑人軟體</option>
</select>
</span>
<span style="position:absolute;border-top:1pt solid #c1c1c1;border-left:1pt solid #c1c1c1;border-bottom:1pt solid #c1c1c1;width:170px;height:19px;">
<input type="text" name="ccdd" id="ccdd" value="可選擇也可輸入的下拉框" style="width:170px;height:15px;border:0pt;">
</span>
</td></tr></table>
</body>
</html>
注意注釋的位置。