cant click a dynamically generated element.

cant click a dynamically generated element.

I have a HTML table which is dynamically generated

The <table> <thead> all tr's and td's within the thead and <tbody> are generated using $.append()

The TR's and TD's and content of the td's inside the <tbody> are created using $.each()

I want to use .on() on these elements
.on() works for the elements generated by append()
but it does not work for elements generated by each()

why is this?