1 2 3 4 5 6 7 8 9 10 11 12 |
$ = jQuery; var c = []; var items = $(".dbem_country option").each(function() { opt = {}; opt.name = $(this).text(); opt.value = $(this).val(); c.push(opt); }).get(); var d = {}; d.data = c; console.log(JSON.stringify(d)); |