function tab(input,div){ for(var i = 0; i < input.length; i++){ input[i].index = i; input[i].onclick = function (){ for(var i = 0; i < input.length;i++){ input[i].className =""; div[i].style.display = "none"; } this.className = "active"; div[this.index].style.display ="block"; } } }
时间: 2024-12-27 14:37:24