pt> function brandChange(id) { var brand_id=$(id).val(); jQuery.post("/mobiles/getcompareid",{brandid:brand_id}, function (data) { if(data!='ERROR') { var data1 = eval(data); jQuery('#edit-citydealer1')[0].options.length=0; jQuery.each(data1, function(i, item) { var opt = new Option(); opt.value = item.cityname; opt.text = item.cityname; jQuery('#edit-citydealer1')[0].options.add(opt); }); } }); }