Javascript not reading value from hidden textBox - JQuery C#
<p>I'm a non-specialist with JavaScript / JQuery and I'm having trouble figuring out why my script doesn't work.  When my C# page loads, I have a hidden textBox txtHiddenKeywordArray which gets dynamically filled with comma separated values like...   horse, buggy, track</p>

<p>I'm trying to use the highlight functionality in jquery.highlight-3.js where I have a label text field that will contain and highlight the words in the keywords list.  I'm using the script</p>

<pre><code>&lt;script language="javascript" type="text/javascript"&gt;
    var myString = document.getElementById('&lt;%=txtHiddenKeywordArray.ClientID%&gt;').val()
    myArray = myString.split(" ");
    $(document).ready(function () {
        for (i = 0; i &lt; myArray.length; i++)
            $("p").highlight(myArray[i])
    });
&lt;/script&gt;
</code></pre>

<p>Here is the textBox declaration :</p>

<pre><code>&lt;asp:TextBox ID="txtHiddenKeywordArray" ClientIDMode="Static" runat="server" Visible="false"&gt;&lt;/asp:TextBox&gt;
</code></pre>

<p>It worked great when I hard coded the values of var myString. I've tried researching it and keep seeing the same example of the way I have it done.  The page does use a MasterPage.  Could this affect it?</p>

<p>Any idea how I can get the script to see the values from the textbox?  Do I need a RegisterStartUpScript or something?  Thanks for any help you can provide.</p>
