Advertisement
archivescode

select_value

Jun 25th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. if ($('#kode_produk').find("option[value='1']").length) {
  2. $('#kode_produk').val('1').trigger('change');
  3. } else {
  4. // Create a DOM Option and pre-select by default
  5. var newOption = new Option('1', 'text 1',true, true);
  6. // Append it to the select
  7. $('#kode_produk').append(newOption).trigger('change');
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement