How To Access Dynamically Created Page Elements with jQuery (not events, ELEMENTS!)

Viewed 3540

I have several dynamically created elements on a page that I would like to POST the contents using jQuery to another page. The problem is, the elements created cannot be accessed via jQuery (only elements that existed on the page can be accessed using the $(#myElementID). I've seen hundreds of posts using the live() and on() functions for accessing EVENTS, but no way to access any properties, values, innerHTML, etc, of the dynamically created ELEMENTS. Is this simply not possible to do with jQuery?

    $('#btnParseTable').click(function () {
        var tblCustomPattern = $("#tblCustomPattern").innerHTML; 


   //This test alert yields "" because tblCustomPattern is undefined - yet FireBug clearly shows the table exists!
        alert(tblCustomPattern); 


 var postData = { "method": "ParseTable", "tbl": tblCustomPattern };
        $.post("tiler.aspx", postData, function (data) {
            $("#test").html(data); //for testing
        });

});

If not supported by jQuery, can this be done in JavaScript or is it not possible to post back information that is NOT an "INPUT" element?

2 Answers
Related