Ah... you're using a master page. You need to either use the 'complex' id or
var ctl = document.getElementById("<%= this.txtControl.ClientID %>");
to embed the value correctly.
+++ Rick ---
>>Script like this is usually placed in 'startup code' which is a script block just before the form tag.
>>
>>That works in most cases or alternately you need a real startup handler like hooking < body onload="" > or using a javascript library like jQuery to reliably tell when the document's properly loaded.
>>
>>Overkill in your situation - you can just use the startup script block on the bottom of the page and that will work fine.
>>
>>+++ Rick ---
>
>My problem is what tblProInfo is the name from the Server. In the HTML code I see
>ct100_ContentPlaceHolder1_tblProInfo instead.
>
>Can I pass the ClientID to the JavaScript from OnCLientClick. Right now I created a little function HideElement
>
>
><script type="text/javascript">
>function HideElement(what)
> {
> var x = document.getElementById(what);
> //alert(x);
> if (x) {
> x.style.display = "none"; }
> }
></script>
>
>And I call it from ASPX OnCLientClick "HideElement('tblProInfo')". I need to pass ClientID here instead.
>
>Thanks a lot in advance.