本文介绍了jQuery过滤器:包含链接(a href =“#")的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个当前链接:

a href="#"

但是不久以后,客户会将链接更改为

but soon the client will change the link to

a href="something"

当链接变成某种东西时,我想使用jQuery更改CSS,但是我不确定如何为属性(href =")编写过滤器...

When the link becomes something I would like to use jQuery to change the css, but I am not sure how to write a filter for an attribute (href="")...

推荐答案

以下是带有href不等于哈希值的锚的选择器:

Here's a selector for an anchor with an href not equal to hash:

$('a[href!="#"]')

这篇关于jQuery过滤器:包含链接(a href =“#")的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-20 12:54
查看更多