clear the labels text value
<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Script2.aspx.cs" Inherits="Javascript.Script2" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
&lt;script language="javascript" type="text/javascript"&gt;
    function ClearValue(Text1, Text2) {
        var txtClear1 = document.getElementById(Text1);
        var txtClear2 = document.getElementById(Text2);
        if (txtClear1 != null || txtClear2 != null)
         {
            txtClear1.outerText = "";
            txtClear1.value = "";
            txtClear1.innerText = "";
            txtClear1.innerHTML = "";
            txtClear1.outerHTML = ""

            txtClear2.value = "";
            txtClear2.innerText = "";
            txtClear2.innerHTML = "";
            txtClear2.outerHTML = ""

            return false;
        }
    }
    &lt;/script&gt;
&lt;html xmlns="http://www.w3.org/1999/xhtml" &gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;asp:Label ID="lblError1" runat="server" Text="Label1"&gt;&lt;/asp:Label&gt;
        &lt;asp:Label ID="lblError2" runat="server" Text="Label2"&gt;&lt;/asp:Label&gt;
        &lt;asp:Button ID="btnClose" runat="server" Text="Button" 
            onclick="btnClose_Click"   /&gt;  
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;



namespace Javascript
{
    public partial class Script2 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

            btnClose.Attributes.Add("onclick", "ClearValue('" + lblError1.ClientID + "','" + lblError2.ClientID + "')");
        }

        protected void btnClose_Click(object sender, EventArgs e)
        {

        }
    }
}
</code></pre>

<p>here  iam not able  to clear the  text  value  of  Label .</p>

<p>once i clcik the  button.here i am trigerring the function  to clear the labels values. </p>

<p>but the text  is not getting cleared.</p>

<p>any idea  how  to solve the issue.</p>

<p>thanks.</p>
