Change the html of span through javascript
<p>I am developing an asp.net web app in which I am using a span tag </p>

<pre><code>&lt;span id = "ptxtAgree" &gt;  &lt;%: data.Agree %&gt;&lt;/span&gt;
</code></pre>

<p>and I want to update the span text through javascript and in script I am writing </p>

<pre><code>  $("#ptxtAgree").text(msg);
</code></pre>

<p>If I am writing the empty span then its value is updated but by using this <code>&lt;%: %&gt;</code> it is not possible.</p>

<p>Sorry for poor English</p>

<p>regards </p>
