javascript getelementbyID does not return value
<p>I am using javascript to get the value of a <code>hiddenfield</code></p>

<pre><code>&lt;script type="text/javascript"&gt;
        $(function() {
            var newYear = document.getElementById('HF');
            alert('hehe' + newYear);
            $('#countdown').countdown({ until: newYear, format: 'DHMS', layout:
'&lt;div id="timer"&gt;' + '&lt;hr /&gt;' +
    '&lt;div id="timer_days" class="timer_numbers"&gt;{dnn}&lt;/div&gt;' +
    '&lt;div id="timer_hours" class="timer_numbers"&gt;{hnn}&lt;/div&gt;' +
    '&lt;div id="timer_mins" class="timer_numbers"&gt;{mnn}&lt;/div&gt;' +
    '&lt;div id="timer_seconds" class="timer_numbers"&gt;{snn}&lt;/div&gt;' +
'&lt;div id="timer_labels"&gt;' +
    '&lt;div id="timer_days_label" class="timer_labels"&gt;days&lt;/div&gt;' +
    '&lt;div id="timer_hours_label" class="timer_labels"&gt;hours&lt;/div&gt;' +
    '&lt;div id="timer_mins_label" class="timer_labels"&gt;mins&lt;/div&gt;' +
    '&lt;div id="timer_seconds_label" class="timer_labels"&gt;secs&lt;/div&gt;' +
'&lt;/div&gt;' +
'&lt;/div&gt;'
            });
        });
&lt;/script&gt;
</code></pre>

<p>This is the aspx code</p>

<pre><code>&lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
        &lt;ContentTemplate&gt;
            &lt;div class="maindeal"&gt;
            &lt;input type="hidden" runat="server" id="HF" /&gt;
                &lt;div class="SocialNetworkShare"&gt;
                    &lt;asp:Label ID="SocialNetworkShare" runat="server" Text="Share" CssClass="SNS"&gt;&lt;/asp:Label&gt;
                &lt;/div&gt;
</code></pre>

<p>Code Behind[I am setting the value for the hidden field in code behind]</p>

<pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If IsPostBack = False Then
            ShowOfferDetails(System.Configuration.ConfigurationManager.AppSettings.Get("DefaultOffer"), True)          '... here "0;0;0" is given as there is no event argument
        End If
        HF.Value = "10/21/2011"
        MsgBox(HF.Value)
    End Sub
</code></pre>

<p>The problem is javascript doesnot detect this value...and throws null exception when i use <code>alert()</code> to check the value.....please help.</p>
