I am trying to add new rows to my table and save them to the DB.
First, I use .append () to add rows to the table:
$("#tablename").append("<tr id='newRow'><td>newly added row</td></tr>");
The add function works great. My page displays the correct result.
However, I cannot select them using
$("#newRow").each(function () { alert "it never reaches here!"; });
I assume this is because elements are added after loading the DOM. Can someone please tell me how can I repeat all my recently added items?
Thank.
source
share