When you use MasterPage in ASP.NET, the webcontrol's clientid will be added with prefix of its container. TextBox1 will be rendered as <input name="ctl00$ContentPlaceHolder1$TextBox1" type="text" id="ctl00_ContentPlaceHolder1_TextBox1" />, the id becomes ctl00_ContentPlaceHolder1_TextBox1, but not TextBox1, so you can't simply use $("#TextBox1") to find it.
Here is my idea to resolve this issue with $("._TextBox1") or $$ ("#TextBox1") syntax, for your reference. http://blog.darkthread.net/blogs/darkthreadtw/archive/2008/12/26/resolving-masterpage-clientid-issue-in-jquery.aspx