Ver Mensaje Individual
  #5 (permalink)  
Antiguo 02/06/2009, 12:38
ind4rk
 
Fecha de Ingreso: febrero-2009
Mensajes: 17
Antigüedad: 15 años, 2 meses
Puntos: 0
Respuesta: Mostrar textarea al seleccionar solo una opcion

Esto es con innerhtml

Código:
<html>
<head>
    <title>Página sin título</title>
</head>
<script type="text/javascript">
        function visible(valor) 
        {
            if (valor == "a")
            {
                //document.getElementById("TextArea1").style.visibility = "visible"
                //document.getElementById("TextArea1").value = valor ;
                document.getElementById("TextArea_Div").innerHTML = "<textarea id='TextArea1' cols='20' rows='2'></textarea>"
             }
             else
             {
             document.getElementById("TextArea_Div").innerHTML = ""
             }
        }
</script>
<body>

    <select id="Select1" onchange="visible(this.value)">
        <option value="a">a</option>
        <option value="b">b</option>
    </select>
    <div id="TextArea_Div"></div>
    
</body>
</html>