busillis Posted October 20, 2008 Share Posted October 20, 2008 <script language="javascript"> function changeVisibility(divname) { if (document.getElementById(divname).style.visibility="visible") { document.getElementById(divname).style.visibility="hidden"; alert('hidden'); exit; } else { document.getElementById(divname).style.visibility="visible"; alert('vis'); exit; } } The if clauses don't seem to be working as I would expect (Might be in need of a coffee!)... If I remove both "exit", it will hide and then reshow. Currently, this code will hide the div and then keep it hidden when the link is reinvoked, again stating "hidden"... Any ideas? Many thanks Link to comment https://forums.phpfreaks.com/topic/129209-solved-changing-div-visibility/ Share on other sites More sharing options...
busillis Posted October 20, 2008 Author Share Posted October 20, 2008 Figured this out, forgot to use "==" for comparision! Link to comment https://forums.phpfreaks.com/topic/129209-solved-changing-div-visibility/#findComment-669876 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.