标签:
1 <script>
2 var obg=document.getElementsByTagName(‘h3‘);
3 var cont=document.getElementsByTagName(‘ul‘);
4
5 function change(num){
6 for(var i=0;i<obg.length;i++){
7 if(num==i){
8 cont[num].style.display=‘block‘;
9
10 obg[num].style.background=‘pink‘;
11 }else{
12 cont[i].style.display=‘none‘;
13
14 obg[i].style.background=‘#ccc‘;
15 }
16 }
17 }
18 </script>
标签:
原文地址:http://www.cnblogs.com/-qiang/p/5794341.html