如何删除"href"与jQuery的? [英] How to remove "href" with Jquery?

查看:112
本文介绍了如何删除"href"与jQuery的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<a id="a$id" onclick="check($id,1)" href="javascript:void(0)"  class="black">Qualify</a>

删除"href"后,是否仍然可以单击合格"?

After "href" is removed, is "Qualify" still clickable?

推荐答案

您的标题问题和您的示例完全不同.我将首先回答标题问题:

Your title question and your example are completely different. I'll start by answering the title question:

$("a").removeAttr("href");

就不需要href而言,普遍接受的方法是:

And as far as not requiring an href, the generally accepted way of doing this is:

<a href"#" onclick="doWork(); return false;">link</a>

必须返回false,以使href实际上不会出现在任何地方.

The return false is necessary so that the href doesn't actually go anywhere.

这篇关于如何删除"href"与jQuery的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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