javascript - 如何禁用此 document.getElementById ("failedUpdateMessage").style.visibility = "hidden";在javascript中

标签 javascript css twitter-bootstrap-3

在我使用该代码隐藏 ID 为“failedUpdateMessage”的元素后,我想在 html 的某个页面中显示该隐藏元素,我将如何使用 java 脚本执行此操作?我会尝试将“隐藏”替换为“显示”,但它不起作用。

最佳答案

你必须使用:

 document.getElementById("failedUpdateMessage").style.visibility ="visible";

注意:show() 适用于使用 jQuery 方法和 display:none 在 CSS 中隐藏的元素(但不是 visibility:hidden)。

关于javascript - 如何禁用此 document.getElementById ("failedUpdateMessage").style.visibility = "hidden";在javascript中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38051626/

相关文章:

JavaScript 中的 PHP : Not working

javascript - 对 Trustpilot 小部件的样式进行了细微调整

javascript - 如何自动添加用户在文本字段中插入的值,然后在 div 上显示总计?

javascript - JS、Rails、CSS - 将按钮与页面上其他内容的底部对齐

html - 如何并排对齐 facebook 和 twitter 共享按钮?

html - 将 Bootstrap 从 3.3.4 升级到 4.0

twitter-bootstrap - bootstrap-table 如何使用搜索和过滤?

javascript - onChange 未在移动设备上触发

css - 调整窗口大小时,底部 div 的绝对位置不会改变

twitter-bootstrap-3 - Bootstrap 3 - 第一次加载页面时弹出错误位置