How to get div content which changed by javascript?
<p>I have a div on page, which content will change by javascript, I want get its value from c# code. but, its always returns empty or initial value, not changed value.</p>

<p>If I changed from div to hidden, it works well. I don't know why?</p>

<p>here is the code:</p>

<pre><code>
&lt;head runat="server"&gt;
    &lt;title&gt;Untitled Page&lt;/title&gt;
    &lt;script type="text/javascript"&gt;
        foo = function()
        {
            var d = document.getElementById('divTest');
            d.innerHTML = 'my value';

            var e = document.getElementById('hiddenTest');
            e.value = 'my value';
        }
    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server" &gt;
    &lt;div&gt;
        &lt;div id="divTest" runat="server"  /&gt;
        &lt;input type="hidden" runat="server" id="hiddenTest" /&gt;
        &lt;input type="button" value="test" onclick="javascript:foo();" /&gt;

        &lt;asp:Button ID="btnTest" runat="server" Text="ASP.NET Button" OnClick="OnbtnTest" /&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
</code></pre>

<p>here is the c# code:</p>

<pre><code>
   protected void OnbtnTest(object sender, EventArgs e)
    {
        Response.Write( string.Format("alert('{0}');", hiddenTest.Value) );
    }
</code></pre>
