通过ajax附加div,我在添加选定的div后给了我指定的类名
<script src="<?php echo site_url()?>assets/js/jquery-3.2.1.min.js"></script>
<script src="<?php echo site_url()?>assets/js/bootstrap.min.js"></script>
<script src="<?php echo site_url()?>plugins/choosen/chosen.jquery.min.js" type="text/javascript"></script
html +='<div class="col-md-4"><div class="form-group"><textarea type="text" name="edit_que1[]" parsley-trigger="change" placeholder="Question 1" class="form-control m-b-15 edit_que" id="edit_que1" rows="2">'+val.question+'</textarea></div>';
html +='<div class="form-group"><select class="form-control chosen-select edit_question" data-placeholder="Select Parameter" id="edit_question'+key+'" name="edit_question[]"></select></div>';
$("#edit_question"+key).val(val.parameter_question);
$("#edit_question"+key).trigger("chosen:updated");
html +='<div class="form-group"><select multiple="multiple" class="form-control chosen-select edit_answer_para" data-placeholder="Select Parameter Value" id="edit_que_ans'+key+'" name="edit_que_ans'+key+'[]"></select></div>';
$("#edit_que_ans"+key).val(val.value);
$("#edit_question"+key).trigger("chosen:updated");
html +='<div class="form-group" id="ans_type2"><div><label>Answer Type</label></div><div class="radio radio-primary form-check-inline"><input type="radio" name="edit_answer_type2" id="edit_yes/no2" value="Yes/No"><label for="edit_yes/no2">Single</label></div><div class="radio radio-primary form-check-inline"><input type="radio" name="edit_answer_type2" id="edit_multiplechoice2" value="Multiple Choice"><label for="edit_multiplechoice2">Multiple Choice</label></div><div class="radio radio-primary form-check-inline"><input type="radio" name="edit_answer_type2" id="edit_input2" value="Input"><label for="edit_input2">Input</label></div></div>'+html1;
});
html+='</div>';
$("#editmyquestions").html(html);
<div id="editmyquestions">
</div>