I want to simulate a click on a select element that at the moment of loading the page, the images are already loaded, since at this moment I load the select with the groups, but I need it selected by default so that when I open the page the images are loaded. thank you I leave the code
$(nombreProdu());
function nombreProdu(busquedaProdu){
$.ajax({
url:'admin/phpadmin/selectProductos.php',
type: 'GET',
dataType:'html',
data : {busquedaProdu: busquedaProdu},
})
.done(function(result){
$("#cbx_carrito").html(result);
})
}
// carga las imagenes al abrir la pagina
$(document).ready(function(){
$('#cbx_carrito').click(function(){
var valor = $('#cbx_carrito').val();
if (valor != null) {
$('#cbx_carrito').val('1').click();
}
});
});
$(document).ready(function(){
$("#cbx_carrito").change(function () {
$("#cbx_carrito option:selected").each(function () {
id_producto = $(this).val();
$.get("php/carritoproductos.php", { id_producto: id_producto }, function(data){
$("#cargaCarrito").html(data);
});
});
})
});