Click here to Skip to main content
15,904,822 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
JavaScript
function showLink()
{
  alert("in function");
  var pass = document.getElementById("pass").value;
  var valid = "3574Hoy";
  alert(valid);
  alert(pass);
  if (pass != valid)
  {
    alert("wrong"); 
  }
  else 
  {
    alert("correct");	
    document.getElementById("downloads").style.visibility = "visible";
  }
}
Posted
Updated 3-Jun-14 1:45am
v2

It would work if you have the Download link something like...
HTML
<a id="downloads" style="visibility:hidden;">Downloads Link</a>

Demo


See how it working.
[Demo] Make anchor Visibility "visible" on Button Click[^]
 
Share this answer
 
I don't see anything wrong in the code - I assume you are getting the 'correct' alert but the element with an Id of 'downloads' does not appear?

First thing to check is that there really is an element with an Id of downloads that is invisible!

I'd run it in debug & check for errors
 
Share this answer
 
check and change your datatype in prog.
 
Share this answer
 
Comments
therainking78 3-Jun-14 7:55am    
In my CSS I have #downloads{visibility:hidden;} to alter the style why would the datatype be wrong?
Check my answer.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900