如何建立无处可去的链接? [英] How do I make a link that goes nowhere?

查看:41
本文介绍了如何建立无处可去的链接?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以建立不执行任何操作的链接?

Is it possible to make a link that does nothing?

我希望该项目成为链接,以便在鼠标悬停时改变光标,但我不希望该链接实际指向任何地方,因为它实际上触发了在同一页面上显示具有附加功能的div.

I want the item to be a link so I get the cursor to change on mouseover, but I don't want the link to actually go anywhere as it actually triggers the showing of a div with extra functionality on the same page.

推荐答案

将添加到浏览器历史记录中:

Will add to the browser history:

<a href="#"></a>

不会添加到浏览器历史记录(首选方法):

Won't add to the browser history (preferred method):

<a href="javascript:;"></a>

这篇关于如何建立无处可去的链接?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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