Skip to content

Instantly share code, notes, and snippets.

@igun997
Last active March 11, 2018 16:55
Show Gist options
  • Save igun997/579e04c151e2a61d837458297668c9c2 to your computer and use it in GitHub Desktop.
Save igun997/579e04c151e2a61d837458297668c9c2 to your computer and use it in GitHub Desktop.
Select2 Add Option On Ajax
var dataSelected = {
id: response.result.id_brk,
text: response.result.id_brk+" - "+response.result.nama_ap
};
var newOption = new Option(dataSelected.text, dataSelected.id, false, false);
$('#ea_pekerjaan_id').append(newOption).trigger('change');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment