Ver Mensaje Individual
  #15 (permalink)  
Antiguo 11/08/2009, 12:00
Pretencioso
 
Fecha de Ingreso: marzo-2009
Mensajes: 6
Antigüedad: 15 años, 1 mes
Puntos: 1
Respuesta: como hacer un boton ocultar ( spoiler en html)

¡Ya encontré la solución a mi problema. Lo comparto por si alguien más llega a necesitarlo.

En head:

<SCRIPT language="javascript">
function MostrarOcultar (objetoVisualizar) {
if (document.all[objetoVisualizar].style.display=='none') {
document.all[objetoVisualizar].style.display='block';
} else {
document.all[objetoVisualizar].style.display='none';
}
}
</SCRIPT>

En body:

<table width="960" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="left" valign="top"><SPAN onMouseOver="this.style.color='99CCFF';this.style. cursor='hand'" onMouseOut="this.style.color='FFFFFF';this.style.t extDecoration='none'" onClick="JavaScript:MostrarOcultar('mostrar1');">P rimer texto (haz click para mostrar)</SPAN></td>
</tr>
<tr id=mostrar1 style="display:none">
<td align="left" valign="top">Texto oculto 1</td>
</tr>
<tr>
<td align="left" valign="top"><SPAN onMouseOver="this.style.color='99CCFF';this.style. cursor='hand'" onMouseOut="this.style.color='FFFFFF';this.style.t extDecoration='none'" onClick="JavaScript:MostrarOcultar('mostrar2');">S egundo texto (haz click para mostrar)</SPAN></td>
</tr>
<tr id=mostrar2 style="display:none">
<td align="left" valign="top">Texto oculto 2</td>
</tr>
</table>

Espero también les sirva. Saludos.