Created
August 1, 2015 08:01
-
-
Save softwarespot/7b69be01fba0ce9e4b97 to your computer and use it in GitHub Desktop.
Append an option element to a select element
This file contains 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
// Append an option element to a select element | |
var $input = $('select'); | |
$('<option/>') | |
.prop('value', value) | |
.html(value) | |
.appendTo($input); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment