I need to toggle the visibility of a label inside a div based on the value of another text box using JavaScript. The function is functioning properly, but in the ASP.NET code-behind, I am using a select case statement to set the visibility of the DIVid
to either True
or False
during page load.
The issue arises when the JavaScript function for hiding the div only works if the initial visibility of DIVid
is set to true during load. Other parts of the JavaScript function, such as disabling a text box, are working correctly.
I suspect that this problem occurs because the script cannot find the DIVid
element when its visibility is initially set to false. How can I resolve this issue?