你好,请问这句话<option>a</option>里面,a的值怎么取?

<select id="xl1" onchange="change()" >
<option >第一</option>
<option>第二</option>
</select>
<select id="xl2" onchange="change()" >
<option >第一</option>
<option>第二</option>
</select>
如果只有选择id=xl1中的“第二”才能显示出来id=xl2中的<select>我改怎么做?
我没分,我不过真是再这里卡住了,谢谢各位

www说
浏览 194回答 2
2回答

慕慕森

<script type="text/javascript">(function() {var xl1,xl2window.onload = function() {xl1 = document.getElementById("xl1");xl2 = document.getElementById("xl2");xl1.onchange = xl2.onchange = change;showItem(xl2, xl1.selectedIndex === 1);};function change(e) {var e = e || window.event;if( this === xl1 ) {var b = this.selectedIndex === 1;showItem(xl2, b)}}function showItem(el, b) {el.style.visibility = b?"visible":"hidden";}})();</script>
打开App,查看更多内容
随时随地看视频慕课网APP