Is it ok to place controls inside UpdatePanel when using jQuery?
<p>With this jQuery code, I am attempting to select the text inside the control, when clicked.</p>

<pre><code>&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;&lt;/title&gt;
    &lt;script src="Scripts/jquery-1.4.1.js" type="text/javascript"&gt;&lt;/script&gt;
    &lt;script type="text/javascript"&gt;

        jQuery(document).ready(
            function () {
                jQuery("input[type='text']").click(function () {
                    this.select();
                });
            });  

    &lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div&gt;
        &lt;asp:TextBox Text="Text 1" ID="txt1" ClientIDMode="Static" runat="server" /&gt;
        &lt;asp:Button Text="Submit" ID="btn1" OnClick="btn1_Click" runat="server" /&gt;
        &lt;asp:TextBox Text="Text 2" ID="txt2" ClientIDMode="Static" Visible="false" runat="server" /&gt;
    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p><strong>Code Behind:</strong></p>

<pre><code>protected void btn1_Click(object sender, EventArgs e)
    {
        txt2.Visible = true;
    }
</code></pre>

<p>The issue is when I put contents of the page inside UpdatePanel, jQuery works on first time on txt1. On button click it doesn't work for any of the textboxes.</p>

<pre><code>    &lt;asp:UpdatePanel runat="server"&gt;
        &lt;ContentTemplate&gt;
            &lt;asp:TextBox Text="Text 1" ID="txt1" ClientIDMode="Static" runat="server" /&gt;
            &lt;asp:Button Text="Submit" ID="btn1" OnClick="btn1_Click" runat="server" /&gt;
            &lt;asp:TextBox Text="Text 2" ID="txt2" ClientIDMode="Static" Visible="false" runat="server" /&gt;
&lt;/ContentTemplate&gt;
    &lt;/asp:UpdatePanel&gt;
</code></pre>

<p>While debugging using Chrome console I found jQuery is not defined - strange :-( Can you please suggest what could be issue.</p>

<p>Thank you for your time.</p>

<p><strong>EDIT:</strong> Based on your responses I tried following these solutions, both worked fine for me.</p>

<p>Binding on event to the form1, and include this on document ready.  </p>

<blockquote>
<pre><code>&gt; jQuery(document).ready(
&gt;       function () {
&gt;           jQuery("#form1").on("click", "input[type='text']", function () {
&gt;               this.select();
&gt;           });
&gt;       });
</code></pre>
</blockquote>

<p>Binding on event to the document itself - </p>

<blockquote>
  <p>jQuery(document).on("click", "input[type='text']" ,function () {
            this.select();
        });</p>
</blockquote>

<p>First one seem to be more safe to me with higher performance, what do you suggest ?</p>
