How do I access a div element using JavaScript while coding in ASP.NET? I am trying to make the div visible after clicking on a button.
The visibility code is shown below:
I encountered an error:
BC30451: 'data1' is not declared. It may be inaccessible due to its protection level.
Javascript
var myDiv = document.getElementById("<%=data1.ClientID %>");
myDiv.style.visibility = 'visible';
Aspx
<div id="data1" class="division" style="visibility: hidden">
</div>