Librerías
De ActionApps Documentacion
Revisión del 17:09 24 nov 2007 de Adam (Discusión | contribuciones)
Captura de propiedades de combo select
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>Ejemplo select</title> <script> function dimePropiedades(){ var texto texto = "El numero de opciones del select: " + document.formul.miSelect.length var indice = document.formul.miSelect.selectedIndex texto += "\nIndice de la opcion escogida: " + indice var valor = document.formul.miSelect.options[indice].value texto += "\nValor de la opcion escogida: " + valor var textoEscogido = document.formul.miSelect.options[indice].text texto += "\nTexto de la opcion escogida: " + textoEscogido alert(texto) } </script> </head> <body> <form name="formul"> Valoración sobre este web: <select name="miSelect"> <option value="10">Muy bien <option value="5" selected>Regular <option value="0">Muy mal </select> <br> <br> <input type=button value="Dime propiedades" onclick="dimePropiedades()"> </form> </body> </html>