![Antiguo](http://static.forosdelweb.com/fdwtheme/images/statusicon/post_old.gif)
15/12/2007, 06:55
|
![Avatar de agressor](http://static.forosdelweb.com/customavatars/avatar203215_1.gif) | | | Fecha de Ingreso: noviembre-2007 Ubicación: Knocking the Death Door..
Mensajes: 368
Antigüedad: 17 años, 2 meses Puntos: 3 | |
Re: Al seleccionar una opcion de un Select que muestre mas elementos pues mira para saber que seleccion uso debemos colocar esto..
<html>
<head>
<script type="text/javascript">
function getIndex()
{
var x=document.getElementById("mySelect");
alert(x.selectedIndex);
}
</script>
</head>
<body>
<form>
Select your favorite fruit:
<select id="mySelect">
<option>Apple</option>
<option>Orange</option>
<option>Pineapple</option>
<option>Banana</option>
</select>
<br /><br />
<input type="button" onclick="getIndex()" value="Alert index of selected option">
</form>
</body>
</html>
Aqui esta solo debes cambiar el alert() por lo que quieras hacer con la opcion seleccionada
SALU2.. |