如何在html中隐藏锚标签。 [英] How can i hide a anchor tag in html.

查看:177
本文介绍了如何在html中隐藏锚标签。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在html中隐藏锚标签?



在用户登录之前,我不想显示搜索选项。



登录后,我想显示搜索选项。

How can I hide an anchor tag in html?

Before the user Login, I don't want to display the search option.

After login, I want to display the search option.

推荐答案

试试这个

< br $>


try this


<a href="#" id="someID" style="visibility: hidden">Check</a>


这里是另一种方式

Here another way
<a href="#" id="someID" style="display: none">Check</a>



使用Javascript


Using Javascript

document.getElementByID('someID')style.display = 'none';


除了Mahendra的正确解决方案:



在Javascript中,这将隐藏它:



In addition to a correct solution by Mahendra:

In Javascript, this will hide it:

document.getElementByID(someID)style.visibility = 'hidden';





这将显示:





This will show it:

document.getElementByID(someID)style.visibility = 'visible';



-SA


这篇关于如何在html中隐藏锚标签。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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