HTML:
<div class="cy_right">
<h3 class="tit">项目概况</h3>
<ul class="cynav">
<li class="current" onclick="liClickOne(this,'merchantsInfo')" >招商信息分布统计</li>
<li class="lb" onclick="liClickOne(this,'majorProject')" >重大项目</li>
</ul>
<div class="year">年份:
<select id="selectYear_lwgOne" onchange="initMerchantsInfo()">
<option value="2013">2013</option>
<option value="2014" selected="true">2014</option>
<option value="2015">2015</option>
</select>
</div>
<div id ="merchantsInfo" class="tc mt30" style="display: block;width:421px;height:253px" >
</div>
<div id ="majorProject" class="tc mt30" style="display: none" >
</div>
</div>
JS:
if(isIE8 || isIE7){
document.getElementById("selectYear_lwgOne").attachEvent("onchange",initMajorProject);
}else{
document.getElementById("selectYear_lwgOne").addEventListener('change',initMajorProject);
}
在IE8和以下版本中,这个“attachEvent”是没用的,我不清楚是我用的不对还是什么其他原因。希望各位前辈们指点!
还有 这个“select”的“onchange”事件,初始化就绑定了上面的“initMerchantsInfo()”这个函数。