Skip to content

Instantly share code, notes, and snippets.

@avireni
Created April 13, 2012 20:38
Show Gist options
  • Save avireni/2380010 to your computer and use it in GitHub Desktop.
Save avireni/2380010 to your computer and use it in GitHub Desktop.
Working with Select Element
//Get the value of a selected option
$('selectElement').val();
//Get the text of a selected option
$('#selectElementId :selected').text();
//Remove an option (e.g. id=1)
$("#selectElementId option[value='1']").remove();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment