What\'s the easiest way to add an option to a dropdown using jQuery?
option
Will this work?
$(\"#mySelect\").append(\'My
If someone comes here looking for a way to add options with data properties
Using attr
var option = $('', { value: 'the_value', text: 'some text' }).attr('family', model.family);
Using data - version added 1.2.3
var option = $('', { value: 'the_value', text: 'some text' }).data('misc', 'misc-value);