Try using below code:
You can trim the page title like:
Or for safer side you can use:
document.querySelector("h1#pageTitle1 span") ? document.querySelector("h1#pageTitle span").innerText.trim() : "&...
Forms is another service which is not a part of SharePoint Online. You can use the Forms web part to help end users to response or display the statistics of the survey. However you will not be able to "add" it to your team site.
Microsoft forms will not be stored/shown on SharePoint directly.
If you want users to respond to Microsoft forms from SharePoint site then you need to create a SharePoint modern page and add Microsoft form on page using Microsoft Forms web part.
Microsoft documentation: Use the Microsoft Forms web part
create Promoted links list with a similar behavior
go to Site Contents > New (plus button) > choose App
create new list as Promoted link then
create your links and set your images as icon there.
this is my result:
this is source: link : promoted link in sharepoint
Read this blog, neex site features to be activated