[Answered ]-Django: Create check boxes dynamically based on select dropdown with Jquery/Ajax?

2👍

it’s is how .wrap works, it appears the element must in the DOM to work, but anyway, there’s no need to wrap it at all, u can just create whatever u want inside the map.

an example here – https://jsfiddle.net/oborudko/eo5x0unr/

  $('#features').empty().append(features[$(this).val()].map(feature => $('<div class="checkbox"><label>' + 
    '<input type="checkbox" name="features[]" value="' + feature.id + '"/>' + feature.name +
    '</label>')
  ));
});

Leave a comment