Universal Login -> Custom Text -> Use Javascript

For the login page, in the “title” input, I have “Welcome to the ${clientName}!”.

I need to remove some text from the clientName.

I’m trying to do this “Welcome to the ${clientName.replace(‘Portal’, ‘’}!”. It’s not working.

How do I use JS text massaging tools in the “Custom Text” area? Is it even possible