Created
November 8, 2014 09:48
-
-
Save Sneezry/237ef5b327df0fc2d23a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<style> | |
#li2, #li3, #li4 { | |
display: none; | |
} | |
</style> | |
<button onclick="show(1)">按钮1</button> | |
<button onclick="show(2)">按钮2</button> | |
<button onclick="show(3)">按钮3</button> | |
<button onclick="show(4)">按钮4</button> | |
<li id="li1">AAAAAA888AAAAAAA</li> | |
<li id="li2">AAAAAA666AAAAAAA</li> | |
<li id="li3">AAAAAA555AAAAAAA</li> | |
<li id="li4">AAAAAA333AAAAAAA</li> | |
<script> | |
function show(n) { | |
document.getElementById('li1').style.display = 'none'; | |
document.getElementById('li2').style.display = 'none'; | |
document.getElementById('li3').style.display = 'none'; | |
document.getElementById('li4').style.display = 'none'; | |
document.getElementById('li'+n).style.display = 'list-item'; | |
} | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment