Ver Mensaje Individual
  #1 (permalink)  
Antiguo 29/12/2008, 10:09
gamers
 
Fecha de Ingreso: octubre-2008
Mensajes: 18
Antigüedad: 16 años, 4 meses
Puntos: 0
pulsar una tecla y que lo escriba en una pantalla

<HTML>
<HEAD>
<TITLE> Foro</TITLE>
</HEAD>

<BODY>
<script type="text/javascript">

function message (t1, t2) {
p = document.createElement ('P')
strong = document.createElement ('STRONG')
p.appendChild (strong)
strong.appendChild (document.createTextNode (t1))
br = document.createElement ('BR')
p.appendChild (br)
p.appendChild (document.createTextNode (t2))
document.getElementsByTagName ('BODY')[0].appendChild (p)
}

</script>

<style type="text/css">

label {display:block}

</style>

</head>
<body>
<div>
<input name="button" value="a" onclick="message('a')" type="button">
<input name="button" value="b" onclick="message('b')" type="button">
<input name="button" value="c" onclick="message('c')" type="button">
</div>
</form>

</body>
</html>

Mi duda es la siguiente: ¿se puede hacer esto con textarea en lugar de botones? en caso afirmativo, ¿decirme cómo?

Última edición por gamers; 29/12/2008 a las 10:45 Razón: explicación