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

205
Visualizações
How do I know when an HTML element is available in the DOM?

Excuse me if my question is not well asked, I will explain the problem. I have an element <div class="o_notification_manager"></div> that appears after an uncertain time on the screen to display notifications. I want to make changes on this element as soon as it is displayed.

I thought of something like this with jquery

$(document.querySelector('.o_notification_manager')).ready(function() {
    console.log(document.querySelector('.o_notification_manager').innerHTML);
});

But I get this error enter image description here

When I use the setTimeout() or setInterval() function, I get two error cases:

  • Either my code runs before the element is displayed and I get the previous error;
  • or my code runs after the element is displayed and the user sees the element change (he sees the content change, the width change). I want my code to run at the same time as the element is displayed. Any help is welcome.
about 4 years ago · Juan Pablo Isaza
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