I needed this a little urgent, can you help? I need to filter a list of spans:
<div class="list-group pre-scrollable lista">
<?php for($i = 0; $i < count($ambientes); $i++) { ?>
<span class="list-group-item listaAmbientes" value = '<?php echo
$ambientes[$i]->id_empresa ?>'>
<div class="row">
<div class="col-sm-8 col-md-9">
<?php echo '('.$ambientes[$i]->id.') '.$ambientes[$i]->nome; ?>
</div>
</div>
</span>
<?php } ?>
</div>
The filter must match the value of a dropdown. This dropdown has id with the company value,
$( "#id_empresa" ).change(function() {
let id_empresa = this.value;
console.log(id_empresa);
filtrarLista(id_empresa);
});
Everything is working, I just need to write this method 'filterList' and update in html, I do not know how to do it, if anyone can help me, I would appreciate it !!