Adding TD Dynamically Using jQuery
<p>I have a method that adds an image to a TD and attaches the click event to the image. I am dynamically building a row and wanted to attach the TD image column to my row. </p>

<pre><code>$("&lt;tr&gt;&lt;/tr&gt;").append(addActionColumn($("&lt;td&gt;&lt;/td&gt;")));
</code></pre>

<p>And here is my addActionColumn method: </p>

<pre><code>function addActionColumn(td) {



    var actionImage = document.createElement("img");
    $(actionImage).attr("src", "../Images/cross_red.JPG");

    // delete the row
    $(actionImage).click(function() {

        $(td).parent().remove();

     });


    $(td).append(actionImage);
}
</code></pre>

<p>For some reason the TR never gets the image column attached to it. </p>
