What\'s the easiest way to add an option to a dropdown using jQuery?
option
Will this work?
$(\"#mySelect\").append(\'My
To help performance you should try to only alter the DOM once, even more so if you are adding many options.
var html = ''; for (var i = 0, len = data.length; i < len; ++i) { html.join('' + data[i]['label'] + ''); } $('#select').append(html);