xhtml:
Código HTML:
<!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>Sin título 1</title> <script type="text/javascript" src="menu.js"></script> </head> <body> <table style="width: 740px; background-color:gray"> <tr> <td class="tdpg3 td10"> <input class="imp3" type="button" onclick="mostrar(atri)" id="1" value="Atributos" /> </td> <td class="tdpg3 td10"> <input class="imp3" type="button" onclick="mostrar(habi)" id="2" value="Habilidades" /> </td> </tr> </table> <div id="atri" name="atri" class="div3" style="width: 740px; height: 500px; visibility: hidden;"> <iframe class="ifr1" src="atri.html" frameborder="0" style="width: 740px; height: 500px;"></iframe> </div> <div id="habi" name="habi" class="div3" style="width: 740px; height: 500px; visibility: hidden;"> <iframe class="ifr1" src="habi.html" frameborder="0" style="width: 740px; height: 500px;"></iframe> </div> </body> </html>
Código PHP:
function mostrar(x){
var obj = document.getElementById(x)
if(obj.style.visibility== "hidden"){
obj.style.visibility= "visible";
}else{
obj.style.visibility= "hidden";
}
}