CSS Visibility

See attached.

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

Doesn't work.

Why?
test_visibility.htm
Richard KortsAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Julian HansenCommented:
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

0
Richard KortsAuthor Commented:
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
0
Julian HansenCommented:
Oops - how ironic is that - pointing out a spelling error with another one.

You are correct it is getElementId  - late and too many posts.

The code still has the spelling error (letters are correct - case is not) - my intent with my last post was not the Document bit - that was a typo it was the ID bit - the second 'd' should be lower case - as per the full post I did.

So, should be

getElementById
Not
getElementByID
<!DOCTYPE html>

<html>
<head>
<title>Test Visibility</title>
<script type="text/javascript">
  function make_visible() {
    // CHANGE getElementByID TO getElementById
    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

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Richard KortsAuthor Commented:
OK, it worked.

I'm POSITIVE that was what I had initially but I must be wrong.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.