Selecting menu elements using Wix Code

I am trying to use $w() to select one of the links in the main menu in the header. I want to be able to change the text of the link (from ‘LOGIN’, which is the name of the page, to ‘PROFILE’) depending on when a user is logged in. Something equivalent to the following javascript:

if (wixUsers.currentUser.loggedIn) {
document.getElementById(“DrpDwnMn04label”).innerHTML = “PROFILE”;
}

In the DOM the anchor contains a

that has the id #DrpDwnMn04label, but using Wix code I only seem to be able to select the menu as a whole and not any child elements of the menu. Using $w(#{menu id}).child does not work. Is there a way to select part of the menu and change the text using Wix Code, or a way to inject raw javascript once the page has loaded?

I’d be really grateful for any answers pointing me in the right direction!