how to access div id in same "table td" using jquery
<p>I have the following code : </p>

<pre><code>&lt;td&gt;
&lt;div  id="div&lt;%# Eval("Id") %&gt;" class="Display"&gt;&lt;%# Eval("Display") %&gt;&lt;/div&gt;
&lt;div class="Actions"&gt;

&lt;/div&gt;
    &lt;div class="Comment"&gt;
    &lt;span&gt;Comment &lt;/span&gt;
    &lt;input id="txt&lt;%# Eval("Id") %&gt;" type="text" width="400px" /&gt;
&lt;/div&gt;
&lt;/td&gt;
</code></pre>

<p>What I am looking for is, when i pressed EnterKey from </p>

<pre><code>&lt;input id="txt&lt;%# Eval("Id") %&gt;" type="text" width="400px" /&gt;
</code></pre>

<p>I want to append text in </p>

<pre><code>&lt;div  id="div&lt;%# Eval("Id") %&gt;" class="Display"&gt;&lt;%# Eval("Display") %&gt;&lt;/div&gt;
</code></pre>

<p>how can I do this?</p>

<p>I did follow this (but not sure if this is the best way)</p>

<pre><code>if (e.which == 13) {
                    var comment = $("#" + this.id).val();
                    var textId = "#" + this.id.replace("txt", "div");
                    $(textId).append(comment);
                    $.ajax({
                        type: "POST",
                        url: "Home.aspx/AddComments",
                        data: "{'id': '" + this.id.replace("txt", "") + "','comments': '" + comment + "'}",
                        dataType: "json",
                        contentType: "application/json",
                        success: function (response) {
                            alert(response.d);
                        }
                    });
                }
</code></pre>

<p><strong>Note : this is itemtemplate, so every div and input element have different id</strong></p>
