PDA

View Full Version : show a div having style="display:none" when get value to the js variable



nischalinn
19 Jun 2012, 11:17 PM
Initially the div id =" showHide" is invisible. I want to make it visible when the value of vall is not null. But the code is not working. Though variable vall is getting values, the div is still not visible. What is the problem with js codescript?? How to solve this problem??

<head>

<script language="javascript">

var vall = "<%=vall%>";

<% System.out.println("jsvar="+vall);%>
/* vall is getting the values*/

if (vall != null)
{
mydiv = document.getElementById("showHide");
mydiv.style.visibility = "visible";

}
</script>
</head>

<body>
<div id =" showHide" style="display:none">

/*HTML TABLE*/
</div>

</body>

zachsformacs95
22 Jun 2012, 02:21 AM
[comment deleted]