In the HTML I am trying to reload this div below;
<select name="test[]" id="test" multiple required
class="select2">
@foreach($tests as $s)
<option value="{{ $s->id }}" {{ ( in_array($s->id, $tests) ) ? 'selected="selected"' : '' }}>
{{ $s->value }}
</option>
@endforeach
</select>
I am using a script to reload the content but losing the select2 functionality for the div here is the snippet I am using to refresh the tag
$( "#test12" ).load(window.location.href + " #test" );