How to create click to full screen

by using DOM, in my html i have create an id=“fullscreenbutton” i want the script will display the full screen and when press esc it will switch of

plz help

here you can see when i launch the project the full screen button display like this i want to use that in my menu option

Hi @rehman97,

You can use the browser Fullscreen API, that’s how the PlayCanvas button works. You can find here a thorough explanation and code examples to work with: