I've tried multiple ways, but they just work on li elements that are in the html file and not the ones being created by a javascript function.
the code is here: https://github.com/inesmm666/forum
The function addAUser in forum.js defines how the li element is going to look like and adds it to the ul with the id("lista-projetos-global") in the forum.html file. The api rest requests are in the api.js file.
Since new elements are added later after the page has loaded, they also miss the appropriate event listeners you setup for the one already rendered. To solve this, you can take advantage of the event propagation by listening for the event in a common ancestor and this technique is called Event Delegation.