Click here to Skip to main content
15,850,547 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I want to open page in full screen mode. i have done it on the click of any button can anyone tell me that is it possible on page load?

If anyone has any solution please help me.

the following code works on click event in javascript

function FullScreen() {
           var docElm = document.documentElement;
           if (docElm.requestFullscreen) {
           else if (docElm.mozRequestFullScree)n) {
           else if (docElm.webkitRequestFullScreen) {

can any one tell me how can i achieve it on page load?
Updated 2-May-21 1:47am

It is totally user action dependent, You can not force the browser to go in full-screen mode.
Check this: Element.requestFullscreen() - Web APIs | MDN[^]
Share this answer
Richard Deeming 6-Dec-19 9:45am    
Looks like you got down-voted for answering an old question.

However, this is the correct answer, and it wasn't mentioned at all by the existing solution.
Try these codes

<script language="jscript" type="text/jscript" >

    $(document).ready(function () {
//Post your code



<script language="javascript" type="text/javascript">
window.onload = function () {
//Post your code
Share this answer
coolnavjot31 18-Apr-12 0:55am    
Hi thanks for ur reply
I have tried ur suggestion but this is not working.

So someone else has any solution of my problem.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900