Ver Mensaje Individual
  #3 (permalink)  
Antiguo 22/02/2011, 09:21
manuelle
 
Fecha de Ingreso: marzo-2009
Mensajes: 155
Antigüedad: 16 años, 1 mes
Puntos: 1
Respuesta: select dinamico

hola ehguacho gracias por responder mira auiq esta mi codigo, te dars cuenta que cuando presiono el boton se modifica el select pero no me muestra el alert porque esta en el onchange del select y este no se dispara

Código:
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title></title>
    </head>
    <body>

        <select id="select" onchange="mostraralert()">
            <option value="1">opccion1</option>
            <option value="2">opccion2</option>
            <option value="3">opccion3</option>
            <option value="4">opccion4</option>
        </select>
        <input type ="button" value="..." onclick="cambiarselect()"/>
    </body>

<script type="text/javascript">

function cambiarselect()
{
   select =  document.getElementById('select').selectedIndex = 2;
}

function mostraralert()
{
   alert('prueba');
}

</script>

</html>