Skip to content

Instantly share code, notes, and snippets.

@stevelippert
Created April 29, 2014 14:21
Show Gist options
  • Select an option

  • Save stevelippert/11401828 to your computer and use it in GitHub Desktop.

Select an option

Save stevelippert/11401828 to your computer and use it in GitHub Desktop.
Adding options to a select list in jQuery
$("#yourIDHERE").append('<option value="something">Your text here</option>');
$("#yourIDHERE").append( $("<option/>", {value: "something", text: "Your text here"}) );
$("#yourIDHERE").append('<option value="gte">&ge;</option>');
$("#yourIDHERE").append( $("<option/>", {value: "gte", html: "&ge;"}) );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment