Hello, I do not have much experience with js and I have a problem, I think it's silly, but I've tried to solve it for days and I can not. I've created a list of HTML elements with the following structure:
HTML
<ul id="NumerosAdicionados" class="fa-ul">
<h6><strong>Numero(s) inserido(s)</strong></h6>
</ul>
Function that adds the numbers
var listaNumeros = [];
function adicionaNumeros() {
var i = listaNumeros.length;
listaNumeros.push(i);
$("#NumerosAdicionados").append("<li id=" + i + " value=" + i + "><i class='fa fa-times-circle' onclick=excluiNumero(" + i + ")></i>" + i + "</li>");
}
Function that excludes numbers
function excluiNumero(indice) {
listaProcessos.splice(indice, 1);
}
With this code it removes the element from the list, but does not remove it from HTML, only when I select the first element to delete it deletes all from HTML.