Tip: you can modify some code before running
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>No name</title><style>#show0,#show1,#show2,#tabContent{ display:none; border:1px red solid;}</style></head><body><div id="daohang">Button 1 button 2 button 3</div> <div id="tabContent"> <div id="show0"> <p>Close</p> <p>111111111111111111111111</p> </div> <div id="show1"> <p>Close</p> <p>22222222222222222222222</p> </div> <div id="show2"> <p>Close</p> <p>333333333333333333</p> </div> </div> <script type="text/javascript">Var daohang = document. getElementById ('daohang '); var tabHere = document. getElementById ('tabcontent'); for (var I = 0; I<daohang.getElementsByTagName('A').length;i++){(function(i){var j = i;daohang.getElementsByTagName('A')[i].onclick = function(){tabHere.style.display = 'block';document.getElementById('show' + j).style.display = 'block';daohang.style.display = 'none';}})(i);}var closeWin = function(id){document.getElementById('show' + id).style.display = 'none';tabHere.style.display = 'none';daohang.style.display = 'block';} </script></body> </html>
Tip: you can modify some code before running