Created
July 8, 2011 15:56
-
-
Save artlogic/1072135 to your computer and use it in GitHub Desktop.
Adding option tags to a select via jQuery.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.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