MDanz Posted June 1, 2011 Share Posted June 1, 2011 i want the div to start off hidden. I know how to make it show and hide. The problem is when i load the page the border is seen. If i use display:none; in the div css the div doesn't display even when i press the button with the function to show. open and close function function infobox(number) { document.getElementById('userinfo').style.display = "block"; //displays userinfo } function closeinfo() { document.getElementById('userinfo').style.display = "none"; } div css #userinfo { position:absolute; text-align:left; width:900px; height:auto; top:100px; left:50%; font-size:14px; font-family:Arial; z-index:20; margin-left:-450px; background-color:#FFFFFF; border:1px solid #264971; } Link to comment https://forums.phpfreaks.com/topic/238144-help-with-div-show-and-hide/ Share on other sites More sharing options...
arbitter Posted June 1, 2011 Share Posted June 1, 2011 I'm no hero, but what if you use document.getElementById('userinfo').style.visibility='hidden' or 'visible'? Link to comment https://forums.phpfreaks.com/topic/238144-help-with-div-show-and-hide/#findComment-1223757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.