I am trying to edit the SharePoint 2016 suitebar links and want to replace "sites" with a custom name and link. I have been able to edit the name via CSS but need to edit the link using JavaScript as I don't believe there is another way. When I launch the page, my function is always hit but the link doesn't always change. It takes a refresh before the Jquery works successfully.
I have tried using document.ready and I've tried delaying by using a timeout but those have not worked.
Here is my simple code:
$(window).load(function nav() {
var $link = $(".o365cs-nav-appTitle");
$link.attr('href', 'site URL');
});