i utilise jquery pour ajouter l'option pour sélectionner il a travaillé, mais je veux ajouterjquery append sélectionnez l'option après l'option
<option value="0">choose category</option>
après tout sélectionné quand je l'ajoute en html, il est caché après sélectionnez l'option apeend
<script type="text/javascript">
$(document).ready(function() {
$('select[name="cat"]').on('change', function() {
$('select[name="subcat"]').removeClass('hidden');
$('select[name="subcat2"]').addClass('hidden');
//$('select[name="subcat2"]').find('option').remove().end();
var stateID = $(this).val();
if(stateID) {
$.ajax({
url: '{{ url('getCat') }}/'+stateID,
type: "GET",
dataType: "json",
success:function(data) {
$('select[name="subcat"]').empty();
$.each(data, function(key, value) {
$('select[name="subcat"]').append('<option value="'+ key +'">'+ value +'</option>');
});
}
});
}else{
$('select[name="subcat"]').empty();
}
});
});
Soyez plus clair ... – clearshot66