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

150
Visualizações
Onclick event creates element with locked size

When I press the button, it will create the element but even though it says it's parent is document.body, the size of the element created is locked to the size of the parent element of the button. the problem shown

function example() {
  let go = document.getElementById("here");
  let toappend = new DOMParser().parseFromString(`<div style="background-color: red; width: 50px; height: 50px;">shouldnt be able to go outside of the bounds of the div the button was in.</div>`, "text/xml");
  go.appendChild(toappend);
}
<div id="here"></div>
<div style="width:200px; length:200px;">
  <button onclick="example()">press this</button>
</div>

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