Skip to content

Instantly share code, notes, and snippets.

@CodeNegar
Created July 17, 2012 06:45
Show Gist options
  • Save CodeNegar/3127674 to your computer and use it in GitHub Desktop.
Save CodeNegar/3127674 to your computer and use it in GitHub Desktop.
javascript: jquery selected dropdown value and text
jQuery("#drop1 option:selected").text(); // text
$("#drop1option").is("selected").text() // text, a little faster
jQuery("#drop1").val(); // value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment