无法改变可见性,是否有人看到我做错了什么? [英] Unable to change the visibility, does anyone see what I'm doing wrong?

查看:70
本文介绍了无法改变可见性,是否有人看到我做错了什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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";
  }
}

推荐答案

如果你有类似的下载链接,它会工作。 />
It would work if you have the Download link something like...
<a id="downloads" style="visibility:hidden;">Downloads Link</a>



演示



了解它是如何工作的。

[演示]使按钮点击屏幕上的锚点可见性可见 [<啊ref =http://jsfiddle.net/taditdash/25tvT/\"target =_ blanktitle =New Window> ^ ]


我看不到代码中有什么问题 - 我假设你得到'正确'警告,但是ID为'下载'的元素没有出现?



首先要检查是的,确实存在一个隐藏下载ID的元素!



我在调试中运行它并检查错误
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


检查并更改prog中的数据类型。
check and change your datatype in prog.


这篇关于无法改变可见性,是否有人看到我做错了什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆