Reputation: 3856
a have a url that is as follows
<a href="www.mysite.com/foo/content">Link</a>
How do I remove the "/foo" using jquery so it'll end up like this.
<a href="www.mysite.com/content">Link</a>
Upvotes: 0
Views: 37
Reputation: 50787
$('a').prop('href', function(i,href){
return href.replace('/foo', '');
});
Upvotes: 4