Ver Mensaje Individual
  #3 (permalink)  
Antiguo 08/02/2011, 20:52
Avatar de fedefrankk
fedefrankk
 
Fecha de Ingreso: agosto-2007
Mensajes: 871
Antigüedad: 16 años, 9 meses
Puntos: 7
Pregunta Respuesta: Mostrar div con javascript

Buenas, gracias por tu tiempo..!!!, en algo fallo yo, no se bien como van los codigos, te muestro lo que hice, sale toda la pantalla en blanco.

Código HTML:
Ver original
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  4. <title>Untitled Document</title>
  5. <div id="num1" onclick="toggle(2)"></div>
  6.  
  7. <div id="num2" style="display:none" onclick="toggle(1)"></div>
  8.  
  9. <script language="JavaScript">
  10. function toggle(opt)
  11. {
  12. if(opt == 1) {
  13.   document.getElementById("num1").style.display='none';
  14.   document.getElementById("num2").style.display='';
  15. } else {
  16.   document.getElementById("num2").style.display='none';
  17.   document.getElementById("num1").style.display='';
  18. }
  19.  
  20. }
  21. </head>
  22.  

Saludos a todos
fede