Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/08/2010, 16:16
estrucarracuda
 
Fecha de Ingreso: agosto-2010
Mensajes: 14
Antigüedad: 14 años, 5 meses
Puntos: 1
Mostrar texto al hacerle click

Hola a todos, voy directo al punto.

Tengo varios items, cada uno en un span y con onclick, al hacerle click quiero que se muestre en una <td> , funciona bien , el problema es que al hacerle click a un item se vé bien pero cuando le hago click a otro item , el anterior se borra.

Como hago pa que se vallan mostrando uno debajo del otro, sin que se borren???


Código Javascript:
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. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <title>Documento sin título</title>
  6. </head>
  7. <script language="javascript">
  8.   function MostrarPlatos(una){
  9.      window.document.getElementById("aaa").innerHTML=una;
  10. }
  11. </script>
  12. <body>
  13. <table width="100%" border="0" cellspacing="0" cellpadding="0">
  14.   <tr>
  15.     <td id="aaa">&nbsp;</td>
  16.   </tr>
  17. </table>
  18. <span id="span1" onclick="MostrarPlatos(1)" style="cursor:pointer">LINK1 </span><br />
  19. <span id="span1" onclick="MostrarPlatos(2)" style="cursor:pointer">LINK2 </span><br />
  20. <span id="span1" onclick="MostrarPlatos(3)" style="cursor:pointer">LINK3 </span><br />
  21. <span id="span1" onclick="MostrarPlatos(4)" style="cursor:pointer">LINK4 </span><br />
  22. <span id="span1" onclick="MostrarPlatos(5)" style="cursor:pointer">LINK5 </span>
  23. </body>
  24. </html>