Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

450
Visualizações
I want to make my div to full screen when page load in javascript

i am working with the javascript to display my div to full screen . i have a function which call on button click and my screen turns into full screen mode but i want the full screen on page load.

what i have tried is

function togglescreen(){
    var element = document.getElementById("video-container");
    element.requestFullscreen();
}
<button id="fullscreenBtn" onclick="togglescreen()">Full Screen</button>
<div id="video-container" width="1000" height="500"></div>

it works perfectly but i need full screen into my page load. i also tried

document.getelementbyId("fullscreenBtn").click();

but it's also not working.

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

It's not possible, it needs to be triggered by the device or user input. It'd be easily abused otherwise.

https://developer.mozilla.org/en-US/docs/Web/API/Element/requestFullScreen

Note: This method must be called while responding to a user interaction or a device orientation change; otherwise it will fail.

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda