I am trying to display a dropdown list based on JSON response object, How I can set it for the following code?
in html
<select class="form-control" name="productCategories[]" id="productCategories<?php echo $x; ?>" onchange="getProductData(<?php echo $x; ?>)" >
</select>
in javascript
$.ajax({
url: 'php_action/fetchDropdownProductData.php',
type: 'post',
data: {brandId : brandId},
dataType: 'json',
success:function(response) {
var html = '<option value="">Select Sub Category</option>';
html += response;
$("#productCategories"+row).html(html);
} // /success
});