亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

你好,請問這句話<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>我改怎么做?我沒分,我不過真是再這里卡住了,謝謝各位
查看完整描述

2 回答

?
慕慕森

TA貢獻1856條經驗 獲得超17個贊

<script type="text/javascript">
(function() {
var xl1,xl2
window.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>



查看完整回答
反對 回復 2021-08-16
  • 2 回答
  • 0 關注
  • 221 瀏覽
慕課專欄
更多

添加回答

了解更多

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號