Link to home
Start Free TrialLog in
Avatar of Richard Korts
Richard KortsFlag for United States of America

asked on

CSS Visibility

See attached.

I want the button "Next" to become visible when "Show" is pressed.

Doesn't work.

Why?
test_visibility.htm
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Basically a spelling error

getDocumentByID
Instead of
getDocumentById
<!DOCTYPE html>

<html>
<head>
<title>Test Visibility</title>
<script type="text/javascript">
	function make_visible() {
		document.getElementById("bsnnext").style="visibility:visible;";
	}	
</script>
</head>
<body>
<input type="button" value="Show" onMousedown="make_visible();"><br>
Hidden button follows<br><br>
<input type="button" id="bsnnext" style="visibility:hidden;" value="Next">
</body>
</html>

Open in new window

Avatar of Richard Korts

ASKER

To Julian Hansen,

Changed as you indicated.

But isn't it getElementByID, NOT getDocumentByID?

Still fails.

Note also this which has it the way I originally had it:

http://www.w3schools.com/jsref/met_doc_getelementbyid.asp

My gut feel is it has to do with the .style="visibility:visible;" part

See attached
test_visibility.htm
ASKER CERTIFIED SOLUTION
Avatar of Julian Hansen
Julian Hansen
Flag of South Africa image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK, it worked.

I'm POSITIVE that was what I had initially but I must be wrong.