$("a").each(function() {
var url = ($(this).attr('href'))
if(url.includes('nofollow')){
$(this).attr( "rel", "nofollow" );
}else{
$(this).attr('rel','dofollow')
}
$(this).attr( "href",$(this).attr( "href").replace('#nofollow',''))
$(this).attr( "href",$(this).attr( "href").replace('#dofollow',''))
})