---
title: "可输入的下拉框，兼容IE6，7，8，9"
author: "pouyang"
date: "2013-06-21T14:26:30Z"
tags: []
categories: ["Web前端"]
slug: "ie6-7-8-9"
draft: false
lastmod: "2013-06-21T17:22:50Z"
id: 1891119
url: "https://pouyang.iteye.com/blog/1891119"
---

有时候因为包含了这一部分导致下拉框不可使用：

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "[http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd](http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd)"&gt;  
&lt;html xmlns="[http://www.w3.org/1999/xhtml](http://www.w3.org/1999/xhtml)"&gt;

或者使用

&lt;meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" /&gt;  （IE6模拟IE8 解决这种不兼容的问题）。

 

 

&lt;html&gt;  
&lt;head&gt;  
&lt;title&gt;&lt;/title&gt;  
&lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;

&lt;/head&gt;  
&lt;body&gt;

 &lt;style type="text/css"&gt;  
 .tdSelect{}  
 .tdSelect div{position: relative;}  
 .tdSelect div span{margin-left:170px; width:28px;  overflow: hidden; }  
 .tdSelect div span select{width: 188px; margin-left: -170px; height:119px;  }  
 .tdSelect div input{height:19px;width: 170px; position: absolute; left: 0px;}  
 &lt;/style&gt;  
 &lt;table&gt;  
   &lt;tr&gt;  
     &lt;th&gt;可手动输入下拉框：&lt;/th&gt;  
     &lt;td class ="tdSelect"&gt;  
     &lt;div&gt;  
         &lt;span&gt;  
             &lt;select id="UIDSelect" onchange="this.parentNode.nextSibling.value=this.value"&gt;  
             &lt;option value="001" &gt;001&lt;/option&gt;  
             &lt;option value="002" &gt;002&lt;/option&gt;  
             &lt;option value="003" &gt;003&lt;/option&gt;  
             &lt;option value="004" &gt;004&lt;/option&gt;  
             &lt;/select&gt;  
         &lt;/span&gt;  
      &lt;input type="text" name="UID" id="UID"  value='' /&gt;  
     &lt;/div&gt;  
     &lt;/td&gt;  
     &lt;td&gt;  
      &lt;input type="button" value="隐藏的值" onclick="alert(document.getElementById('UID').value);" /&gt;  
     &lt;/td&gt;  
   &lt;/tr&gt;  
 &lt;/table&gt;

&lt;/body&gt;  
&lt;/html&gt;