I am generating and adding html within a for loop and then trying to add onclick events aswell, but for some reason it is not working within the same loop:
it