Skip to content

Instantly share code, notes, and snippets.

@artlogic
Created July 8, 2011 15:56
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save artlogic/1072135 to your computer and use it in GitHub Desktop.
Save artlogic/1072135 to your computer and use it in GitHub Desktop.
Adding option tags to a select via jQuery.
$.each(selectValues, function(key, value) {
$('#mySelect')
.append($('<option>', { value : key })
.text(value));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment