Jump to content

[SOLVED] Changing div visibility


busillis

Recommended Posts

<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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.