JavaScript / jQuery setting a content to <div> not sticking after postback
<p>This is my code:</p>

<pre><code>&lt;asp:Button ID="btnSave" runat="server" OnClick="Save" CssClass="StylizedButton" resourcekey="btnSave" /&gt;

   &lt;div id="lbltot"&gt;&lt;/div&gt;
</code></pre>

<p>JavaScript code:   </p>

<pre><code>$(document).ready(function() {
              $("#&lt;%= btnSave.ClientID %&gt;").click(function() {
                  var functionReturn = true;
                  var focusElement = null;
                  var tot = $("&lt;%= lblTotal.ClientID %&gt;").val();
                  var txt1 = $("&lt;%= txt1.ClientID %&gt;").val();
                  var txt2 = $("&lt;%= txt2.ClientID %&gt;").val();
                  var txt3 = $("&lt;%= txt3.ClientID %&gt;").val();
                  var txt4 = $("&lt;%= txt4.ClientID %&gt;").val();
                  var cal = parseInt(txt1) + parseInt(txt2) + parseInt(txt3) + parseInt(txt4);
                  if (cal == 100)
                  { return true; }
                  else {
                      $("lbltot").html("Total must be equal to 100%");  
              focusElement = tot; 
              functionReturn = false;

              }
          });
      });
</code></pre>

<p>On the client side validation, I have to check the value of the <code>TextBox</code>, and the total should be equal to 100.  If true, I should allow it to execute. If not, I need to throw an error stating the total should be 100.</p>

<p>What happens is that, after triggering the submit button, it show the text message only until the postback, and then it disappears. This part:</p>

<pre><code>else {
                          $("lbltot").html("Total must be equal to 100%");  
                  focusElement = tot; 
                  functionReturn = false;
}
</code></pre>

<p>Is there any better way to display the error that persist?</p>
