Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created April 25, 2019 17:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/90f6bd8ca09451e110e5fce171d6d7f7 to your computer and use it in GitHub Desktop.
Save parzibyte/90f6bd8ca09451e110e5fce171d6d7f7 to your computer and use it in GitHub Desktop.
const mostrar = () => {
const indice = $select.selectedIndex;
if(indice === -1) return; // Esto es cuando no hay elementos
const opcionSeleccionada = $select.options[indice];
alert(`Texto: ${opcionSeleccionada.text}. Valor: ${opcionSeleccionada.value}`);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment