Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/08/2003, 10:21
Avatar de franfritz
franfritz
 
Fecha de Ingreso: marzo-2003
Ubicación: Stgo Chile
Mensajes: 260
Antigüedad: 22 años
Puntos: 0
Pregunta mandar a una <div> una varible como HTML desde una funcion

Saludos.

necesito mandar unas variables de este modo, pero como texto html, he tratado con document.form.variable, pero no me muestra nada . agradeceria su ayuda.

algo asi seria lo que estoy haciendo:


<html>
<head>
</head>
<script>
function habilita(form1)
{
edad_x = form1.edad.value;
suma_x = 20 + parseInt(edad_x);
document.getElementById('caja').style.display='';
document.form1.suma.value = suma_x;
}
</script>
<body>
<form name="form1">
ingresa tu edad<input type="text" name="edad"><br>
<input type="button" value="Tu edad en 20 años" onclick="return habilita(this.form)">

<div style="display:none" id="caja">
<table width="100%" border="1" cellspacing="0" cellpadding="3" bordercolor="#FF6600">
<tr>
<td>Tu edad en 20 años
<input type="text" name="suma" size="18" maxlength="0">
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

Entonces en vez del text "suma" desearia que solo fuera un texto html.


de antemano, muchas gracias.