如何附加链接';s HREF与jquery?
我想用jquery将包含“foobar.com/?”的所有链接更改为ad“&t=test”(“foobar.com/?&t=test”) 这是我的代码,似乎不起作用。->如何附加链接';s HREF与jquery?,jquery,append,href,Jquery,Append,Href,我想用jquery将包含“foobar.com/?”的所有链接更改为ad“&t=test”(“foobar.com/?&t=test”) 这是我的代码,似乎不起作用。-> $('a[href*="foobar.com/?"]').attr(href).append('&t=test'); 我的代码有什么问题?或者,有什么更合适的方法来更改所有链接?这是如何做到的 $('a[href*="foobar.com/?"]').each(function(){ this.href += '
$('a[href*="foobar.com/?"]').attr(href).append('&t=test');
我的代码有什么问题?或者,有什么更合适的方法来更改所有链接?这是如何做到的
$('a[href*="foobar.com/?"]').each(function(){
this.href += '&t=test';
});