This is how to add option to an HTML select element with jQuery.
Method 1:
$('#selectElementId').append($('<option>', {
value: 1,
text: 'Option Text'
}));
Method 2:
$("#selectElementId").append(new Option("Option Text", "1")); // where 1 is the value
Method 3:
$('#selectElementId').append('<option value="1">Option Text</option>');
Found this article interesting? Follow Brightwhiz on Facebook, Twitter, and YouTube to read and watch more content we post.