我正在使用 ajax 动态加载 WordPress 页面。它可以正常触发,但我需要排除特定的 anchor 。
<a href="http://store.myurl.com" target="_blank" title="Store">Store</a>
我认为使用 .not() 会像这样工作
$('a').not('a[title=Store]').live('click',function() {
但这破坏了整个事情。
如果我使用 $('a').live('click',function() {
它会正常触发。
附:我无法更改 anchor 输出,例如更改 ID 或类。
最佳答案
属性选择器是否可以在没有引号的情况下工作?我会用
$('a').not('a[title="Store"]').live('click',function() {
关于jquery - 按标题属性排除 anchor 。 - Ajax ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7560211/