javascript timing
<p>I am trying to show a clock on a button click but and calling set timeout event to continuously show the current time. but it shoes only a single time whenever i click the button. and if if i click after some time then it also work but do not show continuously changing time.</p>

<p>script</p>

<pre><code>function showTime() {

        var dat = new Date();
        var h = dat.getHours();
        var m = dat.getMinutes();
        var s = dat.getSeconds();
        var tim = h + " :" + m + ":" + s;
        document.getElementById('MainContent_Label1').innerHTML = tim;
        document.getElementById('MainContent_TextBox1').value = tim;
        var t = setTimeout(showTime(), 1000);

    }
    function Button2_onclick() {
        showTime();
    }
</code></pre>

<p>asp page</p>

<pre><code>asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"&gt;
    &lt;asp:Label ID="Label1" runat="server"&gt;&lt;/asp:Label&gt;
    &lt;br /&gt;
    &lt;asp:TextBox ID="TextBox1" runat="server"&gt;&lt;/asp:TextBox&gt;
    &lt;input id="Button2" type="button" value="button" onclick="return Button2_onclick()" /&gt;&lt;asp:Button ID="Button1" runat="server" Text="Button" 
        onclientclick="showTime()" /&gt;&lt;br /&gt;
    &lt;br /&gt;
&lt;/asp:Content&gt;
</code></pre>
