Internet explorer 愚蠢的IE没有在组合框中显示所选值

Internet explorer 愚蠢的IE没有在组合框中显示所选值,internet-explorer,combobox,selectedvalue,Internet Explorer,Combobox,Selectedvalue,我在IE中遇到了一个奇怪的问题,这在其他浏览器中是不会发生的。打开以下网站: 您将在该页面上看到3个组合框,显示“Lima”。单击任意组合并选择任何其他值,如Lima或Arequipa。页面将刷新,但现在组合框将不会显示所选值,该值应始终为“Lima”(我已硬编码) 如果您查看查看源代码,那么它是一个简单的组合框,我甚至为“Lima”值定义了select=“selected”,但在IE中,它仅在您打开主页时显示selected值。之后,当您从组合框中选择值时,它不会显示值 <select

我在IE中遇到了一个奇怪的问题,这在其他浏览器中是不会发生的。打开以下网站:

您将在该页面上看到3个组合框,显示“Lima”。单击任意组合并选择任何其他值,如Lima或Arequipa。页面将刷新,但现在组合框将不会显示所选值,该值应始终为“Lima”(我已硬编码) 如果您查看查看源代码,那么它是一个简单的组合框,我甚至为“Lima”值定义了select=“selected”,但在IE中,它仅在您打开主页时显示selected值。之后,当您从组合框中选择值时,它不会显示值

<select id="city_id" name="city_id" class="f2_city" onchange="redirect(this.form)">
    <option value="" selected="selected">LIMA</option>
    <option value="LIMA">LIMA</option>
    <option value="Arequipa">Arequipa</option>
</select>

利马
利马
阿雷基帕

我正在使用IE9。

我已经解决了这个问题。刚刚在第页定义了这个

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE8" >

我使用适用于IE7/8/9 Chrome/Firefox等的jquery n-th:child选择器解决了这个问题

var comboId = document.getElementById('YourDropDownListId');
var selectedIndex = comboId.selectedIndex;
var selector = '#TableName:nth-child(' + selectedIndex.toString() + ')';
var selectedTable = $(selector).val();