Jak zastąpić atre href elementu każdym? // strip url
Próbuję zmienić href za pomocą każdej metody,
oto demo, sprawdź, zobaczysz, że nie ma zmian
html:
<a href="#/news">News</a>
<a href="#/news/detail">Detail</a>
<a href="#/sport">Sport</a>
<a href="#/sport/football">Football</a>
jQuery:
$('a').each(function() {
$(this).attr('href').replace('#/',''); //tried to erase #/ from all hrefs
});