谁能帮我把下面的JS用for循环写一下拜托各位大神
哪位高手能帮我把这段代码用for循环的形式写出来functiona(x){switch(x){case1:{document.getElementById('div1')...
哪位高手能帮我把这段代码用for循环的形式写出来 function a(x){ switch(x){ case 1:{ document.getElementById('div1').style.display = ""; document.getElementById('div2').style.display = "none"; document.getElementById('div3').style.display = "none"; break; } case 2:{ document.getElementById('div1').style.display = "none"; document.getElementById('div2').style.display = ""; document.getElementById('div3').style.display = "none"; break; } case 3:{ document.getElementById('div1').style.display = "none"; document.getElementById('div2').style.display = "none"; document.getElementById('div3').style.display = ""; break; } } }
展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询