How to use window.open to open google.com page

I’m a beginner learning html and want to learn to do something useful calling window.open
for example, loading a url like https://www.google.com
My 9 line script attempt below failed. Would kindly appreciate a suggestion to resolve this.

I found a script example that requires a click intervention from user, but want to avoid any
click requirement. I also found an old post in this forum titled “How can i redirect different
users to different pages” but it’s not suitable since I want to retain my call to window.open
For some reason my 9 lines of code were not shown below when I posted this message.

Below’s what I tried:


Script title


New window


window.open(‘https://www.google.com/’),

`;

Sponsor our Newsletter | Privacy Policy | Terms of Service