How can I write javascript functions in content page html and how I call that function
<p>I write two javascript functions in content page. Then I take a html textbox and on the onkeypress event I try to call those two functions, but I am running that application and I didn't find any output to help me. 
Here I am trying to count number of characters in textbox on keypress event. If I write a javascript function in simple page then it runs successfully but it doesn't run in content page help me.</p>

<p>Here is the code</p>

<pre><code>&lt;%@ Page Language="C#" AutoEventWireup="true" MasterPageFile ="~/Site1.Master"  CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %&gt;

&lt;asp:Content ID="Content1" runat="server" 
    contentplaceholderid="ContentPlaceHolder1"&gt;

    &lt;script language ="javascript" type = "text/javascript"&gt;
    maxL=0;
 var bName = navigator.appName;

    function taCount(taObj,Cnt,totmsg) 
    { 
        objCnt=createObject(Cnt);
        objtotmsg = createObject(totmsg);
        objVal=taObj.value;
        if (objCnt) 
        {
            if(bName == "Netscape")
            {   
                //objCnt.textContent = maxL-objVal.length;}
                var totalchar = parseInt((objVal.length - 1) / 160);
                objCnt.textContent = maxL + objVal.length;
                objtotmsg.textContent = totalchar + 1;
            }
            //else{objCnt.innerText= maxL -objVal.length;}
            else
            {
                var totalchar = parseInt((objVal.length - 1) / 160);
                objCnt.innerText= maxL + objVal.length;
                objtotmsg.innerText = totalchar + 1;
            }
        }
        return true;
    }
    function createObject(objId) 
    {
        if (document.getElementById) return document.getElementById(objId);
        else if (document.layers) return eval("document." + objId);
        else if (document.all) return eval("document.all." + objId);
        else return eval("document." + objId);
    }

    &lt;/script&gt; 
&lt;textarea id="TextArea1" onkeyup="return taCount(this,'charcount','totalmsg')" cols="20" rows="10"&gt;&lt;/textarea&gt;

    &lt;asp:Label ID="charcount" runat="server" Text="0"&gt;&lt;/asp:Label&gt;/&lt;asp:Label ID="totalmsg" runat="server" Text="0"&gt;&lt;/asp:Label&gt;

&lt;/asp:Content&gt;
</code></pre>
