The code you posted will get the value as a string
then properly replace
the values but it immediately discards the result. You need to pass in the replaced value to attr
. Try the following
$('a').each(function() {
var value = $(this).attr('href');
$(this).attr('href', value.replace('#/',''));
});?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…