我只想选择不包含 anchor 的链接,例如#。我怎么做? 最佳答案 使用此代码:如果要过滤href =“#”:$('a[href!="#"]') 除此以外:$('a').filter(function(){ return !/#/.test(this.href);//you can filter what you do not want with the regex })