Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

199
Vistas
Element height won't change with getBoundingClientRect()

I'm trying to resize the height of an element by using Element.getBoundingClientRect(). The height of the element was logged before and after element_box.height += 50; where the computed height does change. Yet, the height of the element doesn't change on the page. Why does div height remain 120px when it's suppose to be 170px?

https://jsfiddle.net/sxm2gn48/1/

<div></div>
div {
  border: 1px solid;
  height: 120px;
  width: 130px;
}
let div = document.querySelector("div");

window.addEventListener("load", function(event) {
    const element_box = div.getBoundingClientRect();
    element_box.height += 50;
})
about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda