Dynamic Button creation and event binding

This is in a for loop, this variable is updated each time i create a new button and should supposedly assign on click event to each button that was created.